Hi
How can I set the active navigation item manually, at the moment it is only active if the user is on the page defined in the navigation menu class. However I need to also display that navigation item for other pages?
3 Answer(s)
-
0
It will change based on your architecture. Do you use SPA or MPA?
-
0
Hi
I am using MPA, and cannot figure out how to set it manually.
Can you help?
Thanks in advance.
-
0
Hi,
You can highlight any menu item by setting ViewBag.CurrentPageName to related menu's name. Example:
<a class="postlink" href="https://github.com/aspnetzero/aspnet-zero/blob/master/src/MyCompanyName.AbpZeroTemplate.Web/Areas/Mpa/Views/Languages/Texts.cshtml#L5">https://github.com/aspnetzero/aspnet-ze ... .cshtml#L5</a>
This page is used to edit texts of a specific language, but it highlights languages menu item (which is actually clicked to see list of all languages).