Add span tage to ActionLink title

Posted by Simon Holman on Stack Overflow See other posts from Stack Overflow or by Simon Holman
Published on 2010-04-30T10:36:46Z Indexed on 2010/04/30 10:47 UTC
Read the original article Hit count: 247

Filed under:

I need to add a span tag to the title of an actionlink to output the following html

<li><a href="#" id="topmenu1" accesskey="1" title=""><span>Homepage</span></a></li>

I currently have

<li><%= Html.ActionLink("Homepage", "Index", "Home", null, new { @id= "topmenu1" , @accesskey = "1", @title = "" } ) %></li>

which gives me

<li><a accesskey="1" href="/" id="topmenu1" title="">Homepage</a></li>

without the span tag around Homepage

I cannot use

<span>Homepage</span> 

as the title variable of the actionlink, that doesn't work.

© Stack Overflow or respective owner

Related posts about asp.net-mvc