ASP.NET MVC: generating action link with custom html in it
<a href="http://blah-blah/.....">
<span class="icon"/>开发者_开发问答
New customer
</a>
You can use the UrlHelper class :
<a href="<% =Url.Action("Create","Customers") %>">
<span class="icon"/> New customer
</a>
The MSDN link is here : http://msdn.microsoft.com/en-us/library/system.web.mvc.urlhelper.aspx
For newer versions of .net,
replace
href="<% =Url.Action("Create","Customers") %>"
with
href="@Url.Action("Create","Customers")"
to give something like
<a href="@Url.Action("Create","Customers")">
<span class="icon"/> New customer
</a>
精彩评论