开发者

Add span tage to ActionLink title

开发者 https://www.devze.com 2022-12-28 22:27 出处:网络
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>

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="/"开发者_JAVA百科 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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号