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>
精彩评论