views:

43

answers:

1

I have an Html.Actionlink to which I am trying to add a "class" and an ActiveClass.

<%= Html.ActionLink("Home", "Home", "Account", null, 
    new {@class ="some-class"}, 
    Html.RenderLinkClassIfActive("Home", "Account", "active"))  %>

However, this doesn't work. What can I differently to make this work?

A: 

Could you add the RenderLinkClassIfActive code please?

UPDATE: Supposing Html.RenderLinkClassIfActive("Home", "Account", "active") returns a class if active try:

<%= Html.ActionLink("Home", "Home", "Account", null, new {@class ="some-class " + Html.RenderLinkClassIfActive("Home", "Account", "active") } )%>
SDReyes
sure its (actionName, controllerName, className) - which just shows the link has been selected
Tom
absolute. legend. thx :)
Tom
No problem Tom : )
SDReyes