asp.net updatepanel with dropdownlists-can not select a different item
-
I have an updatepanel with 3 dropdownlist and the selected item from the 1st one binds the 2nd, the selected item from the 2nd binds the 3rd and so on. For example you select a state and then the 2nd ddl has the list of cities in that state. Well when a state is selected, the 2nd shows all the cities but the problem is that I can not select another city. The first on will always be selected and cb2_SelectedIndexChanged doesnt fire. Thanks, Martin <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" > <ContentTemplate> <asp:DropDownList ID="cb1" runat="server" AutoPostBack="true" /> <asp:DropDownList ID="cb2" runat="server" AutoPostBack="true" /> <asp:DropDownList ID="cb3" runat="server" AutoPostBack="true" /> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="cb1" EventName="SelectedIndexChanged" /> </Triggers> <Triggers> <asp:AsyncPostBackTrigger ControlID="cb2" EventName="SelectedIndexChanged" /> </Triggers> <Triggers> <asp:AsyncPostBackTrigger ControlID="cb3" EventName="SelectedIndexChanged" /> </Triggers> </asp:UpdatePanel>
-
I have an updatepanel with 3 dropdownlist and the selected item from the 1st one binds the 2nd, the selected item from the 2nd binds the 3rd and so on. For example you select a state and then the 2nd ddl has the list of cities in that state. Well when a state is selected, the 2nd shows all the cities but the problem is that I can not select another city. The first on will always be selected and cb2_SelectedIndexChanged doesnt fire. Thanks, Martin <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" > <ContentTemplate> <asp:DropDownList ID="cb1" runat="server" AutoPostBack="true" /> <asp:DropDownList ID="cb2" runat="server" AutoPostBack="true" /> <asp:DropDownList ID="cb3" runat="server" AutoPostBack="true" /> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="cb1" EventName="SelectedIndexChanged" /> </Triggers> <Triggers> <asp:AsyncPostBackTrigger ControlID="cb2" EventName="SelectedIndexChanged" /> </Triggers> <Triggers> <asp:AsyncPostBackTrigger ControlID="cb3" EventName="SelectedIndexChanged" /> </Triggers> </asp:UpdatePanel>
- This should have been posted to the ASP.NET forum 2) Format posted code using pre tags, look at forum guidelines 3) Use http://www.asp.net/ajax/ajaxcontroltoolkit/samples/CascadingDropDown/CascadingDropDown.aspx[^]
I know the language. I've read a book. - _Madmatt
-
I have an updatepanel with 3 dropdownlist and the selected item from the 1st one binds the 2nd, the selected item from the 2nd binds the 3rd and so on. For example you select a state and then the 2nd ddl has the list of cities in that state. Well when a state is selected, the 2nd shows all the cities but the problem is that I can not select another city. The first on will always be selected and cb2_SelectedIndexChanged doesnt fire. Thanks, Martin <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" > <ContentTemplate> <asp:DropDownList ID="cb1" runat="server" AutoPostBack="true" /> <asp:DropDownList ID="cb2" runat="server" AutoPostBack="true" /> <asp:DropDownList ID="cb3" runat="server" AutoPostBack="true" /> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="cb1" EventName="SelectedIndexChanged" /> </Triggers> <Triggers> <asp:AsyncPostBackTrigger ControlID="cb2" EventName="SelectedIndexChanged" /> </Triggers> <Triggers> <asp:AsyncPostBackTrigger ControlID="cb3" EventName="SelectedIndexChanged" /> </Triggers> </asp:UpdatePanel>
Don't use multiple Triggers tags. If that isn't the source of your problem it is as least making it tougher to read your code. And if these dropdowns are the only things in the UpdatePanel you should consider just settings ChildrenAsTriggers and not even bother with the individual ASyncPostBackTrigger elements.