---
title: "How to add “active” class to Html.ActionLink in ASP.NET MVC"  
description: "How to add “active” class to Html.ActionLink in ASP.NET MVC"  
author: "Anonymous User"  
published: 2018-05-30  
updated: 2018-05-30  
canonical: https://www.mindstick.com/forum/34497/how-to-add-active-class-to-html-actionlink-in-asp-dot-net-mvc  
category: ".net"  
tags: ["asp.net mvc", "mvc"]  
reading_time: 1 minute  

---

# How to add “active” class to Html.ActionLink in ASP.NET MVC

I want to [add](https://www.mindstick.com/forum/12983/add-address-in-textbox-when-page-is-load-and-if-i-search-address-in-textbox-show-in-map-by-javascript) the [active](https://answers.mindstick.com/qa/97113/why-does-an-active-ftp-not-work-with-network-firewalls) [class](https://www.mindstick.com/blog/165/generic-class-in-c-sharp) in [bootstrap](https://www.mindstick.com/articles/1555/image-viewer-using-bootstrap-carousel) 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>
```

\

## Replies

### Reply by Anonymous User

You have to add active class in li

```
<ul class="nav navbar-nav">
    <li class="active">@Html.ActionLink("Home", "Index", "Home")</li>
    <li>@Html.ActionLink("About", "About", "Home")</li>
    <li>@Html.ActionLink("Contact", "Contact", "Home")</li>
</ul>
```


---

Original Source: https://www.mindstick.com/forum/34497/how-to-add-active-class-to-html-actionlink-in-asp-dot-net-mvc

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
