Using jquery mobile: postback inside an updatepanel resets data-role="panel"
in jQuery Mobile
•
9 years ago
I am using jquery mobile (http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.js) with a c# .Net 4 web application.
I have a div set up like this:
I have a div set up like this:
- <div data-role="panel" id="MenuItemPanel" data-display="overlay" data-position="right" style="width: 262px;padding: 0 10px;" data-theme="d" >
- <asp:UpdatePanel ID="updpnlrdo" runat="server" >
<ContentTemplate> - <asp:RadioButtonList ID="rdobtnlst" runat="server" EnableViewState="true" OnSelectedIndexChanged="rdobtnlst_SelectedIndexChanged" AutoPostBack="true" />
- </ContentTemplate>
</asp:UpdatePanel> - </div>
on the backend of the page I have the code set up like this:
- protected void rdobtnlst_SelectedIndexChanged(object sender, EventArgs e)
{
string lsScript = "OpenMenuItemPanel();";
ScriptManager.RegisterClientScriptBlock(this,typeof(Page), "myFunc", lsScript, true);
}
and the OpenMenuItemPanel() javascript function looks like this:
- function OpenMenuItemPanel()
{
alert('OpenMenuItemPanel')
$("#MenuItemPanel").panel("open");
}
I cannot get the div to stay open after the postback to the rdobtnlst_SelectedIndexChanged method even though it is in an updatepanel. Can anyone help?
1