I am extending Html.HtmlHelper to display a palette depending on the page:
Html.HtmlHelper
public static HtmlString RenderBreadCrumb(this HtmlHelper helper, PageType pagetype, object Model)
How to use Url.RouteUrl inside an HtmlHelper to display a URL?
Url.RouteUrl
You need to create a new UrlHelper instance using the request context.
UrlHelper Url = new UrlHelper(helper.ViewContext.RequestContext); Url.RouteUrl(…);
Just create the UrlHelper extension:
public static string RenderBreadCrumb(this UrlHelper helper, PageType pagetype, object Model)
Then call through:
@Url.RenderBreadCrumb(pageType, Model)
Source: https://habr.com/ru/post/885522/More articles:jQuery $ (document). already broken in Iron / Chrome - javascriptHow to escalate error messages - javaMagento dynamically changes layout using a system variable - layoutMac OS X: open the application at login without showing the main window - loginusing a map to retrieve a hash set (key, value) matching the given value - perlIs there a way to disable multiple buttons at a time? - vbaHow to tag a Git repository with Xcode 4 - gitJSON array with properties - jsonGrails creates Criteria - grailsHow to enable editing and continuation in Visual Studio - debuggingAll Articles