I have form with 2 DDL named
State and City
State:
<asp:UpdatePanel ID="States" runat="server" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="States"EventName="SelectedIndexChanged" />
</Triggers>
<ContentTemplate>
<asp:DropDownList ID="States" runat="server"
AutoPostBack="True" DataSourceID="StatesObjectDataSource"
AppendDataBoundItems="true"
onselectedindexchanged="States_SelectedIndexChanged">
<asp:ListItem Value="-1" Text="- None -"/>
</asp:DropDownList>
<asp:ObjectDataSource ID="StatesObjectDataSource" runat="server"
onselecting="StatesObjectDataSource_Selecting"
SelectMethod="GetStates"
TypeName="Something">
</asp:ObjectDataSource>
</ContentTemplate>
</asp:UpdatePanel>
City:
<asp:DropDownList ID="Cities" runat="server">
</asp:DropDownList>
When they choose a state I want to populate the Cities DDL with all the cities for that state.
In code behind I am able to get to
States_SelectedIndexChanged(object sender, EventArgs e)
and i try to populate the Cities DDL by this
Cities.Items.Add(new ListItem(city,city));
However, I do not see my Cities DDL populated