UpdatePanel.Visible = true has no effect

旧街凉风 提交于 2019-12-07 05:36:03

问题


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


回答1:


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.




回答2:


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.




回答3:


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.




回答4:


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.



来源:https://stackoverflow.com/questions/590099/updatepanel-visible-true-has-no-effect

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!