手风琴控制 - 回发时手风琴窗格不可见
我动态地将 Accordian Panes 添加到 Ajax Accordion 中。在回发时,我无法访问动态创建的 Accordian 窗格和 ACC.Panes.Count=0
如果窗格不是动态创建的,则一切正常。所以我认为这与从代码后面创建窗格时的 DOM 有关。
我的情况有解决方法吗?
有没有类似Ajax Accordion更好的控件?
I am dynamically adding Accordian Panes to an Ajax Accordion. On PostBack i cannot access the dynamically created Accordian Panes and 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.
is there any workaround for my case?
is there any better control similar to Ajax Accordion?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该在每次回发的 Page_Init 事件上重新绘制手风琴,以便能够在回发后访问它们。
You should redraw the accordion on the Page_Init event on each post back in order to be able to access them after the post back.
所有动态生成的控件都会在回发时丢失,这就是为什么您必须在页面的 Init 事件中重新定义它们,然后它们将始终可用。
All dynamic-generated controls are lost on postback, that's why you must re-define them in your page's Init event, then they will be available always.