Multiple dependent dropdownlists in whidbey

G

Geoff Taylor

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
 
C

Chandra Sekhar

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top