tags:

views:

16

answers:

1

I have an action link like this:

<%=Html.ActionLink(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.

+1  A: 

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.

Darin Dimitrov