I’m investigating ASP.NET MVC now and noticed that in ASP.NET MVC application, which is created by Visual Studio by default, links “Home” and “About” are staying active when the user is on “Home” and “About” page correspondingly, and after clicking on the current page link page is reloading itself.
What is the correct approach to disable link which points to the page, a user is already on?
How to do it without violating ASP.NET MVC approach?
“Disabling” in terms of html is simply removing href tag. There cannot be any asp-net-mvc-magic here. you need to render your menu in a way that sets href to “” for current page.
For details, i’d recommend you to refer “Pro ASP.NET MVC Framework” book, chapter 5.