forum

Home / DeveloperSection / Forums / How to add “active” class to Html.ActionLink in ASP.NET MVC

How to add “active” class to Html.ActionLink in ASP.NET MVC

Anonymous User 1113 30-May-2018

I want to add the active class in bootstrap navabar

<ul class="nav navbar-nav">

  <li>@Html.ActionLink("Home", "Index", "Home", null, new {@class="active"})</li>
  <li>@Html.ActionLink("About", "About", "Home")</li>
  <li>@Html.ActionLink("Contact", "Contact", "Home")</li>
</ul>



Updated on 30-May-2018
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By