ASP.NET MVC: creating an action link with custom html in it


How can I create an action link with custom html inside.
Like the following:
<a href="http://blah-blah/.....">
<span class="icon"/> New customer
</a>

+6
asp.net-mvc asp.net-mvc-2 actionlink
source share
1 answer

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

+8
source share

All Articles