I have been using ASP.NET MVC for a very long time and have frequently used @Html.ActionLink throughout my code base, but I recently needed to create a static link to the Web API Help and I was wondering if there was a standard way of creating a hyperlink using an MVC Razor Html Helper that did not need to go through an MVC Controller.
Well, fortunately, there is!
Instead of using @Html.ActionLink, you simply use @Html.RouteLink as follows:
That was all there is to it!!
Well, fortunately, there is!
Instead of using @Html.ActionLink, you simply use @Html.RouteLink as follows:
@Html.RouteLink("Help", new { }, new { href = "/help" })
No comments:
Post a Comment