Navigation menu with highlight in Asp.NET MVC?

后端 未结 7 896
广开言路
广开言路 2021-02-14 15:31

It\'s a simple question. How did stackoverflow do their menu in Asp.net MVC, with highlight on what page we are on.

7条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-14 16:29

    If you look at the page source, they've added a css class to the

  • element to change the background color. I'm guessing the code looks at what controller the user is accessing (questions, users, etc) and adds the class to that section's
  • tag.

提交回复
热议问题