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;
有一项艰巨的任务。有一个更新面板upDetails,当用户从主表中选择任何项时,它显示详细信息表(initialy visible = false),我们应该设置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
但它无论在我放置它的任何地方/事件中都不起作用 - 既不是BL方法,也不是预渲染。它仍然是隐形的
But when I do not make it initialy invisible, all works fine
但是,当我不首先隐形时,一切正常
What do I do wrong?
我做错了什么?
Thanks in advance
提前致谢
4 个解决方案
#1
9
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.
你在谈论ASP.NET Ajax UpdatePanel控件吗?尝试在UpdatePanel中放置一个“真正的”Panel Control(asp:Panel),并在该控件上设置visibilty false / true,并使UpdatePanel可见。
#2
3
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).
如果updatepanel visibility可以设置为false,则不会在输出上呈现它。没有呈现,它不存在客户端,然后它不能使用(不是由ajax事件)。
Using a placeholder is the solution to your problem.
使用占位符是解决问题的方法。
#3
2
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
1
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.
您应该检查以确保包含面板的任何控件都可见。如果不是,则在updatepanel控件上设置visible属性将不执行任何操作,因此您需要确保容器控件是第一个可见的。
#1
9
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.
你在谈论ASP.NET Ajax UpdatePanel控件吗?尝试在UpdatePanel中放置一个“真正的”Panel Control(asp:Panel),并在该控件上设置visibilty false / true,并使UpdatePanel可见。
#2
3
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).
如果updatepanel visibility可以设置为false,则不会在输出上呈现它。没有呈现,它不存在客户端,然后它不能使用(不是由ajax事件)。
Using a placeholder is the solution to your problem.
使用占位符是解决问题的方法。
#3
2
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
1
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.
您应该检查以确保包含面板的任何控件都可见。如果不是,则在updatepanel控件上设置visible属性将不执行任何操作,因此您需要确保容器控件是第一个可见的。