Okay, my site is http://www.kristianbak.com.
I have a css class called activebutton. I want that to change whenever another View is active. Currently it’s merely hard-coded in the HTML (sitemaster).
Anyone with a good idea?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could test the current action and if it matches apply a CSS class:
Even better I would write a HTML helper to generate the menu:
and then use it like this:
This will add the
activeclass to the anchor if the current request matches the action and controller of the link.