-2
在我的asp.net应用程序中,我有两个dropdownlist,如果我选择第一个的一个值,意味着自动想要更改下拉两个值,但它不工作。这里是我的asp代码。我如何使用ASP.NET更新面板?
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text="State"></asp:Label>
<asp:DropDownList ID="ddlState" runat="server" Height="23px" Width="195px" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"
AutoPostBack="True">
<asp:ListItem>--Select--</asp:ListItem>
<asp:ListItem>Kerela</asp:ListItem>
<asp:ListItem>Tamilnadu</asp:ListItem>
<asp:ListItem>Karnataka</asp:ListItem>
</asp:DropDownList>
<br />
<br />
<br />
<br />
<asp:Label ID="Label2" runat="server" Text="District"></asp:Label>
<asp:DropDownList ID="ddlDistrict" runat="server" Height="23px" Width="189px" AutoPostBack="True">
</asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
什么不起作用。请解释这个问题。另外,发布帖子后面的代码会很有用。 – webnoob
将您的代码发布到'DropDownList1_SelectedIndexChanged' – Emre