asp.net - jquery mobile 和 asp.net updatepanel 问题

标签 asp.net jquery-mobile

我正在 asp.net webforms 中使用 jquerymoble。

以下是我的代码。

在部分回发(在下拉选择更改时),我缺少 updatepanel 下所有控件的 css 样式。

我该如何解决这个问题?

    <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>

最佳答案

你需要告诉jquery mobile刷新控件

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

关于asp.net - jquery mobile 和 asp.net updatepanel 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10816473/

相关文章:

.net - DataTable.Select ("Bla=' Blablabla '").Count Returns ' Count' 不是 'System.Array' 异常的成员

jquery - 使用 SmartBanner 将横幅保留在网站标题上方

c# - Jquery Mobile 会自动在我的 "&lt;input type=submit"> 上方添加文本,我该如何防止这种情况发生?

css - Phonegap/JQuery HTML 未正确呈现

javascript - 在代码中使用 .attr ("disabled"时,Jquery Mobile 多选列表禁用选项不起作用

c# - 在 ASP.NET 页面上显示 XML 的最简单方法

c# - session 变量 + WebMethod 变量值未更新

asp.net - Azure 应用服务部署中心无法从 GitHub 存储库进行部署

jquery - Rails 的 jquery 移动布局的一个很好的例子是什么?

asp.net - BuildManager.GetReferencedAssemblies 等效于非 Web 应用程序