开发者

Getting the link, not the anchor tag in ASP.NET MVC

I'd like to write:

 <a href='@Html.LinkGenerator'>Edit</a>

instead of:

@开发者_JS百科Html.ActionLink("Edit", "Edit")

Where @Html.LinkGenerator is the name of an imaginary helper which only creates the link, not the whole anchor tag, for a given route and action.

What should I do?


You could use the Url.Action helper which is not imaginary but very real and does what you need:

<a href="@Url.Action("Edit", "Edit")">Edit</a>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜