Click here to Skip to main content
15,609,978 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends,
Please help me about my problem..

I want to show panel on button click event.
when button is pressed the panel is fade in and displayed.
i tried using Ajax but when post back occur panel is invisible.

Please Help Me,
Thanks In advance,

Well, that is because you made the change in UI using Javascript. State was not maintained.

In order to persist it, you need to either keep a flag regarding visibility in a hidden field OR use XMLHttpRequest to save the state of the Panel after making it visible.

For simplicity, use Hidden Fields. At the time of showing the panel, set the value to true. While postback/page re-render, check the value of this hidden field and based on the value set the visibility of the panel.
Share this answer
You should use javascript for this. Here's an example:[^]
Share this answer
Dalek Dave 22-Jul-10 6:18am    
Excellent link, may use it myself!
Well, you need to write all client side code to do that, obviously. Why would an AJAX call make any difference, it's also going to not cause any postback.

Perhaps if you posted code, we could tell what the issue is ?
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900