开发者

MVC, change the style of action link

I have an action link like this:

<%=Html.ActionLin开发者_开发问答k(Name + " (" + Count+ ")", "ActonName", "Controller", new { ID= itemID}, null)%>

it shows

football (5)

I want it displays like this:

football (5)

I have try to change the actionlink like this:

<%=Html.ActionLink(Name + " <b>(" + Count+ ")</b>", "ActonName", "Controller", new { ID= itemID}, null)%>

it does not work. any idea to to this?

Many thanks.


ActionLink always encodes the text. You could use Url.Action:

<a href="<%= Url.Action("ActonName", "Controller", new { ID = itemID }) %>">
    <b>(<%= Count %>)</b>
</a>

or write a custom HTML helper if you don't like the tag soup.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜