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.
精彩评论