views:

34

answers:

1

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

+1  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

mathieu
o, it is much obvious, that I thought :) Thanks!
alexb
BTW, I've found some helpful info here: http://stephenwalther.com/blog/archive/2009/03/03/chapter-6-understanding-html-helpers.aspx and here http://iridescence.no/post/Rendering-Action-Links-in-ASPNET-MVC-Applications.aspx
alexb