c# - Creating link with html content -


I want to create some HTML helpful tasks to create some links from the generated HTML content I will follow the default API as much as possible. It becomes difficult when I want to pass in a route object. To create MVC, a routing object type RouteValueDictionary is cumbersome (intentionally?) I am passing through an object pathway as i.e. html.ActionLink . The hard part is that I need UrlHelper.CreateUrl , which requires RouteValueDictionary . I checked how ActionLink does this internally, and it uses the TypeHelper.ObjectToDictionary . TypeHelper Although there is an internal class, so I can not reach it. I can copy-paste that thing, but - besides this, I am violating the license if I do this and the Apache 2.0 license or does not license under the relevant, and the other copy-pasteing programming me-Havi-Jeebies .

The following is what I want to broadly do:

  public static MvcHtmlString MyFancyActionLink (This HtmlHelper Assistant, FuFoo, Object Margavuja) {TagBuilder inner = fancyFooContent (foo ); Rootelevation Routridict = TypeHalper.ObjectOutquation (Root Value); // to regret! TypeHelper is internal! String url = UrlHelper.GenerateUrl (empty, "uncontrollable", "macrocontroller", ritidic, accessory.looking.txt, copyright, truth); Tagbilder link = new tag builder ("a"); Link.MergeAttribute ("href", url); Link.InnerHtml = inner.toString (); Return MvcHtmlString.Create (link.ToString ()); }  

Accepts an object in the RouteAvailability page and to populate the dictionary Uses properties. As long as I'm not clarifying anything here, you should be able to use that:

  RouteValueDictionary routedict = new route (actual route);  

Comments