Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

AnchorTagHelper - add class?

$
0
0

I am using a menu system based on jQuery which creates a navbar. Each navbar item has the usual structure: <li><a asp-controller="..." asp-action="...">nav-item-x</a></li>. When selecting an item a small javascript is adding "is-selected" to the <li> elements class attribute. Of course this is gone as soon as the new page is rendered.

Is there an option to tell the AnchorTagHelper to add "is-selected" to the including <li> element? Or something else I can do to achieve this?


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>