Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. asp.net updatepanel with dropdownlists-can not select a different item

asp.net updatepanel with dropdownlists-can not select a different item

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpasp-netsysadminhelptutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Martin_
    wrote on last edited by
    #1

    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>

    N T 2 Replies Last reply
    0
    • M Martin_

      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>

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2
      1. 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

      1 Reply Last reply
      0
      • M Martin_

        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>

        T Offline
        T Offline
        T M Gray
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups