62,046
社区成员
发帖
与我相关
我的任务
分享
<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>