我有 2 个 ddl、ddlCountry 和 ddlState,在选择 ddlCountry 时,ddlState 会根据所选国家/地区进行更新,但是...当我选择 ddlState 时,ddlState 中的所选项目未标记为选中,因此我无法获得选定的值。
这是代码:
<asp:DropDownList
ID="ddlReceiverCountry"
runat="server"
CssClass="textBox"
OnSelectedIndexChanged="ddlReceiverCountry_SelectedIndexChanged"
AutoPostBack="true" >
</asp:DropDownList>
<br />
<asp:UpdatePanel ID="updatePanel" runat="server" UpdateMode="Conditional" >
<ContentTemplate>
<asp:Label ID="lblReceiverState" runat="server" Text="State" CssClass="newReceiverlabel">
</asp:Label>
<asp:DropDownList
ID="ddlReceiverState"
runat="server"
CssClass="textBox" OnSelectedIndexChanged="ddlReceiverState_SelectedIndexChanged">
</asp:DropDownList>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="ddlReceiverState" />
<asp:AsyncPostBackTrigger ControlID="ddlReceiverCountry" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>