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>

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

  • 相关阅读:
    写了一个具有future接口的rust测试代码
    lua:写了个基于协程的task调度库
    最近阅读
    电视投屏
    树莓派 系统备份
    Kindle支持的文件格式
    树莓派 more
    用google translate大文件
    NFC 大电池 高性价比手机
    rust debug之基于pdb
  • 原文地址:https://www.cnblogs.com/jstblog/p/14785424.html
Copyright © 2011-2022 走看看