我想在VS2005里面在处理省市2级联动的时候
     <asp:ScriptManager runat="server" id="scriptmanager1">
                                </asp:ScriptManager>
                                
                                <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">                                
                                 <ContentTemplate>     <asp:DropDownList ID="dropProvince" runat="server" Width="135px" OnSelectedIndexChanged="dropProvince_SelectedIndexChanged" AutoPostBack="True">
                                </asp:DropDownList>
                                <asp:DropDownList ID="city" runat="server" Width="135px">
                                </asp:DropDownList>
                                
                                </ContentTemplate>
                                
                                </asp:UpdatePanel>一切绑定操作都在后台进行。用 ajax那些控件只是想让它不刷新就行的。
    就是在选定省以后 马上出来市的那一刻不刷新页面!
   

解决方案 »

  1.   

    <body>
        <form id="form1" runat="server">
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource1"
                        DataTextField="name" DataValueField="code">
                    </asp:DropDownList><asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Data Source=.;Initial Catalog=lx;Persist Security Info=True;User ID=liuzhanjun;Password=000000"
                        ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM [province]"></asp:SqlDataSource>
                    <asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="SqlDataSource2"
                        DataTextField="name" DataValueField="provinceId">
                    </asp:DropDownList><asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="Data Source=.;Initial Catalog=lx;Persist Security Info=True;User ID=liuzhanjun;Password=000000"
                        ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM [city] WHERE ([provinceId] = @provinceId)">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="DropDownList1" Name="provinceId" PropertyName="SelectedValue"
                                Type="String" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                </ContentTemplate>
            </asp:UpdatePanel>    </form>
    </body>
      

  2.   

    不刷新的话你可以用第三方控件啊AJAX就可以啊,
    里面有个UPDATEPANLE控件,可以实现整页刷新,
    局部页面刷新,你可以研究研究!