Users Pricing

forum

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

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

Anonymous User 1576 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>

1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md