我在手风琴控件中有两个updatepanel,如下所示:
<accordion>
<first pane content>
<updatepanel UpdateMode="conditional">
<contenttemplate>...</contenttemplate>
<triggers>...</triggers>
</updatepanel>
</first pane content>
<second pane content>
<updatepanel>
<contenttemplate>...</contenttemplate>
<triggers>...</triggers>
</updatepanel>
</second pane content>
</accordion>
面板更新一次,但在此之后,不会进行任何更新。如果我刷新页面,那么我可以看到更新的信息。这意味着正在更新数据库,但updatepanel未刷新(第一次刷新后)。为什么会这样?
这已经困扰了我好几天,所以任何建议都会非常感激。 谢谢!
更新
这个问题似乎在于我称之为:
Sys.require(Sys.components.accordion, function() {
$("#acca_profile").accordion({
HeaderCssClass: "acc_header",
HeaderSelectedCssClass: "acc_selectedheader",
FadeTransitions: true,
suppressHeaderPostbacks: true,
requireOpenedPane: false
});
});
endRequestHandler
函数中的。但是,如果我不打电话,那么应该转换为手风琴的div不再是手风琴。
更新2
经过一些工作后,我发现问题可能在于Jquery在部分回发后没有重新绑定事件。许多解决方案都声称你必须注册客户端脚本,但我在aspx页面的顶部有这个:
<asp:ScriptManager runat="server" EnablePageMethods="true">
<Scripts>
......(其他剧本) Path =“http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js”/&gt;
</Scripts>
</asp:ScriptManager>
如何在代码中重新绑定JQuery事件?
答案 0 :(得分:1)
最后,我想我已经解决了!几小时代码耗尽了几个小时。这不总是这样吗? :d 对于遇到这个帖子的人,我补充道:
Sys.Application.add_init(pLoad);
然后我创建了一个名为pLoad
的函数,其中包含我的手风琴javascript(原始帖子),以及其他一些函数。
到目前为止,事情似乎正在发挥作用......