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

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

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