开发者

ASP.NET MVC View Profile

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

<%= Html.ActionLink("Home", "Home", "Acco开发者_运维问答unt", null, 
    new {@class ="some-class"}, 
    Html.RenderLinkClassIfActive("Home", "Account", "active"))  %>

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


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") } )%>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜