Hi, I have two updatepanels inside an accordion control, laid out like this:
<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>
The panel updates once, but after that, no updates take place. If I refresh the page, then I can see the updated information. This means that the database is being updated, but the updatepanel isn't refreshing (after refreshing the first time). Why is this happening?
This has been bugging me for days, so any advice would be much appreciated. Thanks!
update
The problem seems to lie when I call this:
Sys.require(Sys.components.accordion, function() {
$("#acca_profile").accordion({
HeaderCssClass: "acc_header",
HeaderSelectedCssClass: "acc_selectedheader",
FadeTransitions: true,
suppressHeaderPostbacks: true,
requireOpenedPane: false
});
});
in the endRequestHandler
function. However, if I don't call it, then the div that should be converted to an accordion is no longer an accordion.
Update 2
After a bit more work, I figured the problem may lie in the fact that the Jquery is not rebinding the events after the partial postback. A lot of solutions claim that you have to register the client script, but I have this at the top of my aspx page:
<asp:ScriptManager runat="server" EnablePageMethods="true">
<Scripts>
... (other script) Path="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" />
</Scripts>
</asp:ScriptManager>
How can I rebind the JQuery events in my code?