nav: highlight active page with active class and aria-current
Add PageHelpers.ActivePage extension and apply it to top-level nav items and the Account/Register + Account/Signin items in _LoginPartial, so the current route gets the active class and aria-current="page" for accessibility.
This commit is contained in:
parent
f055ac45df
commit
325cb339fd
3 changed files with 45 additions and 6 deletions
|
|
@ -49,10 +49,10 @@
|
|||
else
|
||||
{
|
||||
<li class="dropdown-item">
|
||||
<a class="nav-link" asp-controller="Account" asp-action="Register" >Register</a>
|
||||
<a class="nav-link @PageHelpers.ActivePage(ViewContext, "Account", "Register")" asp-controller="Account" asp-action="Register" >Register</a>
|
||||
</li>
|
||||
<li class="dropdown-item">
|
||||
<a class="nav-link" asp-controller="Account" asp-action="Signin" asp-route-ReturnUrl="~/" asp-route-AllowRememberLogin="true" >Signin</a>
|
||||
<a class="nav-link @PageHelpers.ActivePage(ViewContext, "Account", "Signin")" asp-controller="Account" asp-action="Signin" asp-route-ReturnUrl="~/" asp-route-AllowRememberLogin="true" >Signin</a>
|
||||
</li>
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue