Navigation menu with highlight in Asp.NET MVC? -


it's simple question. how did stackoverflow menu in asp.net mvc, highlight on page on.

there no mvc special magic makes happen.

i'm sure:

if( httpcontext.current.request.path == "some menu url" ) 

or

if( viewcontext_or_controllercontext.routedata.values["controller"] == "some value")  

is used someplace.

you put code in 3 different locations ( view ( .aspx ), viewmodel, custom htmlhelper ) , require same bit of code.


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -