开发者

How to get just the URL of an Action in an ASP.NET MVC View?

I开发者_如何学C want to get the URL of a route using the same syntax as Html.ActionLink, but don't know how to do that from my View.

Is there an HtmlHelper extension that works like ActionLink but returns only the URL?

For instance, I want to write:

<img src="<%= Html.ActionUrl("Image", new { id = 42 }) %>" />


Check out:

Url.Action()

Aka:

<img src="<%= Url.Action("Image", new { id = 42 }) %>" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜