[ad_1]
I have a layout
page that has a side navigation bar
and in that side navigation bar, there are a few buttons to navigate to different parts of the application. That layout is being used by some Razor
pages in my application. By default, in the layout navigation bar, the Dashboard
option is selected and highlighted and that is because of the active
class placed on it. When I click on any of the other buttons (for example Layouts) on the nav bar, a call to the controller action method is sent which returns another view using the same layout but because the page is refreshed it resets the highlighted text to default which is Dashboard. I am trying to set the active class on the button that was clicked but due to page refresh, it is setting back to default (Dashboard).
I am trying to make the button highlight that is being clicked. I used JQuery
to add an active class to it but as the page refreshes all changes are reset on the layout page. Is there any other way other than Ajax
and partial views
? Any help is highly appreciated. Thank you
[ad_2]