Hi. I don't need a Link but rather only the href= part of the ActionLink.
But if I call Html.ActionLink(...) I get a back. Is there a way to just return the URL of the Action while not getting the ?
Hi. I don't need a Link but rather only the href= part of the ActionLink.
But if I call Html.ActionLink(...) I get a back. Is there a way to just return the URL of the Action while not getting the ?
Edit: in response to commment, now including parameters:
<% =Html.BuildUrlFromExpression<YourController>(c => c.YourAction(parameter)) %>
MVC also provides a UrlHelper class which can do the same thing:
<%=Url.Action(actionName)%>
<%=Url.Action(actionName, htmlValues)%>
<%=Url.Action(actionName, controllerName, htmlValues)%>