ActionUrl in ASP.NET MVC Preview 5

I do not need a link, but rather only href = part of ActionLink.

But if I call Html.ActionLink (...), I will return. Is there a way to simply return the action url without receiving?

+6
model-view-controller asp.net-mvc
source share
2 answers

MVC also provides an UrlHelper class that can do the same thing:

<%=Url.Action(actionName)%> <%=Url.Action(actionName, htmlValues)%> <%=Url.Action(actionName, controllerName, htmlValues)%> 
+10
source share

Edit: in response to Commment, now including options:

 <% =Html.BuildUrlFromExpression<YourController>(c => c.YourAction(parameter)) %> 
+2
source share

All Articles