ASP.NET MVC Preview 5中的ActionUrl

Tig*_*ine 6 model-view-controller asp.net-mvc

我不需要链接,而只需要动作链接的href =部分.

但如果我打电话给Html.ActionLink(...)我会回来.有没有办法只返回Action的URL而没有得到?

小智 10

MVC还提供了一个UrlHelper类,它可以做同样的事情:

<%=Url.Action(actionName)%>
<%=Url.Action(actionName, htmlValues)%>
<%=Url.Action(actionName, controllerName, htmlValues)%>
Run Code Online (Sandbox Code Playgroud)