ASP.NET MVC: how to include <span> in link from Html.ActionLink?

Viewed 26403

I need the text of a link wrapped with <span> as in:

<a href="/foo.html"><span>Edit Group</span></a>

Can I do that with Html.ActionLink? This doesn't work:

<%=Html.ActionLink("<span>Edit Group</span>", "Edit", New With {.id = "bar"})%>

It just HTML encodes the < and > as &lt; and &gt;.

Is there a simple solution, or should I build the links by hand with Url.Action?

This is for use with jQuery-UI Tabs. Tab labels need to be wrapped in <span> to get animation when AJAX content is loading.

5 Answers
Related