简体   繁体   中英

Keeping track of selected list item in a master page

As per the functionality of the headers in stackoverflow (Questions, Tags, Users, Badges, ...), I would like to keep track of which list item a user has selected in an ASP.NET MVC view so I can apply a different style or image.

What is the best way to do this?

If you look closely at Stack Overflow you will notice that each of these links points to a different controller, which most likely (I'm guessing) renders a different view just reusing some UI elements through a common master page. So there's no need to 'remember' anything, how the returned page looks like is defined in a view for that page.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM