Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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


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

like image 797
alex.b Avatar asked Oct 07 '10 07:10

alex.b


1 Answers

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

like image 72
mathieu Avatar answered Nov 17 '22 13:11

mathieu