0

I am trying to implement this theme for my website https://getstisla.com/demo/dashboard-ecommerce.html

I noticed that on the site, if you click a menu item, it sets a list item active on the menu.

However, I have tried to implement it and it but when I click on the menu item, nothing is set as active aside from the home item.

This is the menu

<div class="main-sidebar sidebar-style-2">
<aside id="sidebar-wrapper">
    <div class="sidebar-brand">
        @Html.ActionLink("App", "Index", "Home", new { area = "" }, new { @class = "" })
    </div>
    <div class="sidebar-brand sidebar-brand-sm">
        @Html.ActionLink("A", "Index", "Home", new { area = "" }, new { @class = "" })
    </div>
    <ul class="sidebar-menu">
        <li class="active"><a asp-controller="Home" asp-action="Index" class="nav-link"><i class="far fa-square"></i><span>Home Page</span></a></li>

        <li class="menu-header">AM Mode</li>
        <li class="nav-item dropdown">
            <a href="#" class="nav-link has-dropdown"><i class="fas fa-fire"></i><span>Configuration</span></a>
            <ul class="dropdown-menu">
                <li><a asp-area="Configuration" asp-controller="AC" asp-action="Index" class="nav-link">A C</a></li>
                <li><a asp-area="Configuration" asp-controller="B" asp-action="Index" class="nav-link">B</a></li>
            </ul>
        </li>
    </ul>
</aside>
</div>

I have tried searching through the files for the javascript that sets the menu item active but I haven't found it so far. I was hoping someone could take a look and see if I'm missing something.

The files can be downloaded from here https://cssauthor.com/bootstrap-templates/#Admin

JianYA
  • 2,750
  • 8
  • 60
  • 136

1 Answers1

0

This is more of a ASP.NET question IMO. Possible duplication of How to add “active” class to Html.ActionLink in ASP.NET MVC

EDIT:

The theme is hardcoding those class="active" in static *.html files, this theme is not a Single Page Application.

I have tried searching through the files for the javascript that sets the menu item active

You won't find it, JavaScript is not setting the active class.

enter image description here

jaredrethman
  • 512
  • 5
  • 16
  • Not really. its more css jquery as the question I asked was if this particular theme had that chunk of code instead of how to add an active class to a html actionlink. I already know that. – JianYA Mar 02 '19 at 11:07
  • Oh... Thank you. I'll need to create one by myself then. – JianYA Mar 02 '19 at 12:31