Multiple dependent dropdownlists in whidbey

Discussion in 'ASP .Net Building Controls' started by Geoff Taylor, Aug 6, 2004.

  1. Geoff Taylor

    Geoff Taylor Guest

    Hi,

    I'm trying to get 3 DropDownLists in an ASP.NET 2.0 page working
    together so that the value selected in DropDownList1 is used as a
    parameter which tells DropDownList2 how to populate itself. Equally,
    the value selected in DropDownList2 should tell DropDownList3 how to
    populate itself. The three DropDownLists should work as follows:
    Continent > Country > Region

    When I select something in the Continent DropDownList, Country
    changes, but Region does not. Does anyone know how I can get all three
    DropDownLists synchronised together?

    Thanks in advance,

    Geoff Taylor
     
    Geoff Taylor, Aug 6, 2004
    #1
    1. Advertising

  2. Here is how I would do:

    1. If people use Refresh often, I suggest you to go with scripting (people
    get frustrated seeing the repost option).

    On change of any dropdown, call a javascript which will get the selected
    values of all the other dropdowns and form a querystring and navigates to
    the same page with the new querystring. Handle on page load, depending on
    each qs value, populate the dropdowns.

    2. If you don't care about the Refresh Button, here is another simple way:

    Populate the dropdowns on pageload (not postback)

    Just have SelectedItemChange event to handle just the particular
    dropdown. It will work good.

    Sekhar.

    "Geoff Taylor" <> wrote in message
    news:...
    > Hi,
    >
    > I'm trying to get 3 DropDownLists in an ASP.NET 2.0 page working
    > together so that the value selected in DropDownList1 is used as a
    > parameter which tells DropDownList2 how to populate itself. Equally,
    > the value selected in DropDownList2 should tell DropDownList3 how to
    > populate itself. The three DropDownLists should work as follows:
    > Continent > Country > Region
    >
    > When I select something in the Continent DropDownList, Country
    > changes, but Region does not. Does anyone know how I can get all three
    > DropDownLists synchronised together?
    >
    > Thanks in advance,
    >
    > Geoff Taylor
     
    Chandra Sekhar, Aug 6, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Darren

    Multiple DropDownLists

    Darren, Aug 18, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    412
    Steve C. Orr, MCSD
    Aug 18, 2003
  2. Craig Buchanan

    reuse SQLDataReader in multiple dropdownlists?

    Craig Buchanan, Jan 12, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    3,284
    Craig Buchanan
    Jan 15, 2004
  3. puzzlecracker
    Replies:
    1
    Views:
    523
    James Kanze
    Aug 7, 2008
  4. stephen

    Dependent DropDownLists

    stephen, Aug 31, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    119
    Naveen
    Sep 5, 2004
  5. Chester

    Dependent dropdownlists without an auto postback

    Chester, Jul 30, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    222
Loading...

Share This Page