Reputation:
There is a wide task. There is an update panel upDetails, which displays details table (initialy visible = false) when user selects any item from master table, we should set upDetails.Visible = true;
But it soesn't work whatever place/event I had placed it - neither BL methods, neither pre-render. It still be invisible
But when I do not make it initialy invisible, all works fine
What do I do wrong?
Thanks in advance
Upvotes: 5
Views: 13930
Reputation: 31
If updatepanel visibility is set to false, it's not rendered on the ouput. Not being rendered, it doesn't exist client side where it then cannot be used (not event by ajax).
Using a placeholder is the solution to your problem.
Upvotes: 3
Reputation: 6931
I searched long and far, experimented, and could not get this to work, unfortunately. My final decision was to wrap the content I wanted to show/hide within Placeholder controls. They give you the flexibility of toggling visibility without adding markup.
Upvotes: 2
Reputation: 47726
You should check to make sure that whatever control contains you panel is visible. If it is not, setting the visible property on the updatepanel control will do nothing so you will need to make sure the container control is visible FIRST.
Upvotes: 2
Reputation: 104040
Are you talking about the ASP.NET Ajax UpdatePanel Control? Try to put a "real" Panel Control (asp:Panel) inside the UpdatePanel and set the visibilty false/true on that control and leave the UpdatePanel visible.
Upvotes: 10