Users Pricing

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 1491 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>

I am a content writter !


1 Answers