[ASP.NET MVC] How can I show content in another div only when a menu item is active?
I'd like to show content only when a menu item is active using ASP.NET MVC. How would I be able to achieve this?
In this case, I'd like to just display nothing, until the user clicks on the menu bar, with "ShowContent1, ShowContent2, ShowContent3". When the user clicks on one of these, lets say, ShowContent2, the code will show only Content2. But if the user goes from ShowContent2 to ShowContent1, it will "remove" Content2, and show Content1. I'd imagine, the code will something be based on this. Is this the correct direction? How would I do this?
Thanks
<div class="nav"> <ul> <li><a href="Con1">ShowContent1</li> <li><a href="Con2">ShowContent2</li> <li><a href="Con3">ShowContent3</li> </ul> </div> <div class="actionShower"> @{ if(Con1){ //show content of content 1 }else if(Con2){ //show content of content 2 }else if(Con3){ //show content of content 3 }else{ //show nothing } } </div>
0 comments:
Post a Comment