title: Unable to Highlight Active Link in MVC 4
body: <p>i'm trying to highlight the current link in MVC 4 but i cannot do this, i'm sharing what i have done so far</p>
  
  <p>MenuHelper Extension:</p>
  
  <pre><code>public static class MenuHelper
      {
          public static MvcHtmlString ListItemAction(this HtmlHelper helper, string name, string actionName, string controllerName)
          {
              var currentControllerName = (string)helper.ViewContext.RouteData.Values["controller"];
              var currentActionName = (string)helper.ViewContext.RouteData.Values["action"];
              var sb = new StringBuilder();
  
              sb.AppendFormat("&lt;li{0}", (currentControllerName.Equals(controllerName, StringComparison.CurrentCultureIgnoreCase) &amp;&amp;
                                                  currentActionName.Equals(actionName, StringComparison.CurrentCultureIgnoreCase)
                                                      ? " class=\"active\"&gt;" : "&gt;"));
              var url = new UrlHelper(HttpContext.Current.Request.RequestContext);
              sb.AppendFormat("&lt;a href=\"{0}\"&gt;{1}&lt;/a&gt;", url.Action(actionName, controllerName), name);
              sb.Append("&lt;/li&gt;");
              return new MvcHtmlString(sb.ToString());
          }
      }
  </code></pre>
  
  <p>THis is my HTML</p>
  
  <pre><code>&lt;li class="has-sub active"&gt;
              &lt;a href="javascript:;" class=""&gt;
                  &lt;i class="icon-magnet"&gt;&lt;/i&gt;Manage
                  &lt;span class="arrow open"&gt;&lt;/span&gt;
                  &lt;span class="selected"&gt;&lt;/span&gt;
              &lt;/a&gt;
              &lt;ul class="sub"&gt;
                  @{
  
  
                          @Html.ListItemAction("Parts", "Index", "Part")
                          @Html.ListItemAction("Categories", "Index", "Category")
                          @Html.ListItemAction("Tickets", "Index", "Ticket")
                          @Html.ListItemAction("SearchLog", "Index", "SearchLog")
                          @Html.ListItemAction("Reviews", "Index", "Review")
  
  
                  }
  
  
  
              &lt;/ul&gt;
  
          &lt;/li&gt;
  </code></pre>
  
  <p>this is just highlighting the link but i want to change the LI tag class as well because of my design. i have other links as well i want that when the link is clicked the parent LI tag will be assigned with the active class.how i can do this? i have searched internet but couldn't get any method to solve this.</p>