简体   繁体   English

手风琴控件-手风琴窗格在PostBack上不可见

[英]Accordion Control - Accordion Pane not visible on PostBack

I am dynamically adding Accordian Panes to an Ajax Accordion. 我正在将Accordian Panes动态添加到Ajax手风琴中。 On PostBack i cannot access the dynamically created Accordian Panes and ACC.Panes.Count=0 在回发后,我无法访问动态创建的Accordian Panes和ACC.Panes.Count=0
if the panes are not dynamically created everything works fine. 如果未动态创建窗格,则一切正常。 so i think that is has to do with the DOM while creating the panes from code behind. 所以我认为这与从背后的代码创建窗格时与DOM有关。
is there any workaround for my case? 我的案子有什么解决方法吗?
is there any better control similar to Ajax Accordion? 有没有像Ajax手风琴一样更好的控件?

您应该在每个回发的Page_Init事件上重绘手风琴,以便能够在回发之后访问它们。

所有动态生成的控件都会在回发时丢失 ,这就是为什么必须在页面的Init事件中重新定义它们的原因,因此它们将始终可用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM