asp.net mvc routing - How to Highlight Active Tab Using Navigation Routes in Twitter Bootstrap MVC4 -
my question how highlight active tab using route-based menu system twitter bootstrap mvc4. if parent tab contains child routes, when child route selected, corresponding parent tab should highlighted. please consider example code below , thank help.
below example routeconfig:
routes.mapnavigationroute<dashcontroller>("parent 1", c => c.index(), "", true); routes.mapnavigationroute<maincontroller>("parent 2", c => c.index()) .addchildroute<maincontroller>("child 1", c => c.do_something(), "", true) .addchildroute<maincontroller>("child 2", c => c.do_something_else(), "", true) ;
below example _layout shared view:
<div class="nav-collapse collapse"> <ul class="nav"> @html.navigation() </ul> </div>
in twitterbootstrapmvc there way set links active inside nav using extension methods: .setlinksactivebycontroller()
or .setlinksactivebycontrollerandaction()
Comments
Post a Comment