zoukankan      html  css  js  c++  java
  • asp:DropDownList不刷新页面问题

    相信很多小伙伴做数据联动碰到asp:DropDownList刷新页面都会很苦恼。

    废话不多说,看法宝。

    <asp:DropDownList ID="ddlcountry" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlcountry_SelectedIndexChanged">
                                </asp:DropDownList>

    由于设置了 AutoPostBack="true" 属性,若为fals,后台不更新数据列表:很烦。

    查阅了大量网址,终于找到了不刷新的办法。

    asp中UpdatePanel标签,完美的解决了这个问题。

                        <asp:ScriptManager ID="ScriptManager1" runat="server">
                        </asp:ScriptManager>
                        <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
                            <ContentTemplate>
                                <asp:DropDownList ID="ddlcountry" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlcountry_SelectedIndexChanged">
                                </asp:DropDownList>         
                            </ContentTemplate>
                        </asp:UpdatePanel>
                        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                            <ContentTemplate>
                                <asp:DropDownList ID="ddpostway" runat="server">
                                </asp:DropDownList>
                            </ContentTemplate>
                        </asp:UpdatePanel>

    后端数据绑定我就不解释了。

  • 相关阅读:
    English trip -- VC(情景课)1 A Get ready
    隔板法总结
    CF 题目选做
    ZROI 提高十连测 DAY2
    2019 09 05
    线性基总结
    解决痛苦的方法/cy
    梅深不见冬 树上贪心
    ZROI 提高十连测 Day1
    [USACO09NOV]硬币的游戏 博弈 dp
  • 原文地址:https://www.cnblogs.com/jstblog/p/14785424.html
Copyright © 2011-2022 走看看