ASP.net MVC - Navigation and highlighting the “current” link

前端 未结 9 1553
清酒与你
清酒与你 2020-12-30 11:10

When you create a new MVC project it creates a Site.master with the following markup:

    <
9条回答
  •  隐瞒了意图╮
    2020-12-30 11:34

    You could do this by using "data-" attributes to identify the container(s) then using jQuery change CSS class of the link, like the following:

    • @Html.ActionLink("About", "About", "Home")
    • @Html.ActionLink("Contact", "Contact", "Home")

提交回复
热议问题