Adding “active” tag to navigation list in an asp.net mvc master page

后端 未结 15 1902
渐次进展
渐次进展 2020-12-12 13:31

In the default asp.net mvc project, in the Site.Master file, there is a menu navigation list:

15条回答
  •  长情又很酷
    2020-12-12 14:01

    Inside a view, you can get the current action name with:

    ViewContext.RouteData.Values["action"].ToString()
    

提交回复
热议问题