aWebdesigner09
aWebdesigner09

Reputation: 267

jquery mobile and asp.net updatepanel issue

I am working with jquerymoble in asp.net webforms.

The following is my code.

On Partial postback(on dropdown selection change), Iam missing css-styles for all the controls under updatepanel.

How can I resolve this?

    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div data-role="page">
    <div data-role="content">
<a href="#page2" data-role="button" data-inline="true" data-rel="dialog" data-corners="true" data-shadow="true" data-iconshadow="true" data-wrapperels="span" data-theme="c">     Open Dialog </a>
</div>
    </div>
    <div id="page2" data-role="dialog">

        <div data-role="header" data-theme="d" role="banner">
        <h1 class="ui-title" role="heading" aria-level="1">Dialog</h1>
        </div>

        <div data-role="content" data-theme="c" role="main">
            <h1>Delete page?</h1>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>

            <asp:DropDownList ID="ddlTest" runat="server" AutoPostBack="true" 
                onselectedindexchanged="ddlTest_SelectedIndexChanged">
            <asp:ListItem Text="One" Value="1"></asp:ListItem>
            <asp:ListItem Text="Two" Value="2"></asp:ListItem>
            <asp:ListItem Text="Three" Value="3"></asp:ListItem>
            </asp:DropDownList>
                <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>


            <asp:Label ID="lblText" runat="server" Text="Label"></asp:Label>
            <asp:Label ID="lblValue" runat="server" Text="Label"></asp:Label>
            <br />


            </ContentTemplate>
            </asp:UpdatePanel>

        </div>
    </div>
    </form>

Upvotes: 2

Views: 1767

Answers (1)

AndyMcKenna
AndyMcKenna

Reputation: 2647

You need to tell jquery mobile to refresh the controls

$("#<%=UpdatePanel1.ClientID%>").trigger("create");

Upvotes: 3

Related Questions