I am new in ASP.NET Core. I have a navigation menu and I would like to track the active item. My idea is to use the action and controller names as navigation keys:
<
Use
var controller = ViewContext.RouteData.Values["Controller"]; var action = ViewContext.RouteData.Values["Action"];
PS: Use ToLower() if required
ViewContext.RouteData.Values["Action"].ToString().ToLower();
Also you can activate your menu by style block