I have a page with multiple panels on it. When a user clicks on a button one panel becomes invisible and another becomes visible. I was wondering if it is possible to dim the entire page except for the panel that has just become visible?
Share
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.
The asp.net panels will be rendered as
in the html, so why not write some javascript which which sets these to hidden? You could give them a class which you use to identify what to hide e.g.
and then hide all the divs based on that. As Tim B James suggests, JQuery is great for doing this kind of thing, and can give you animations, fading, delays etc, which are really easy to get started with.
If you’d rather do it in the code-behind, you could loop through all the panels, finding and hiding them programmatically. Then show the correct one. This solution might be best if you have complex validation or something needed for the panel contents.