DropDownList depending on DropDownList

J

Jonathan

Hi everyone,
i have made two dropdownlist controls. On my first one, i have the country
and on the second one, the state (for example) if i selected the United
States country. So depending on wich country i selected in my first
dropdownlist control, i load my information in my second dropdownlist.

How i did this is by setting my first dropdownlist (country) to
AutoPostBack=True so that my 2nd dropdownlist is refreshed with it's
content when the SelectedIndexChanged event is fired.

My problem is that my browser refreshes each time to load the second
dropdownlist depending on what choice i made on my first dropdownlist
control.

So I was thinking that there must be a way (in Asp.Net) to load
automatically (without browser's refresh) my second dropdownlist. I know i
could possibly do that in javascript but i want to make it in .Net (if
possible). I am using vb in my aspx files.

Any help, tips, informations, sites, articles is greatly appreciated

Thanks in advance!

Jonathan
 
P

Paul Clement

¤ Hi everyone,
¤ i have made two dropdownlist controls. On my first one, i have the country
¤ and on the second one, the state (for example) if i selected the United
¤ States country. So depending on wich country i selected in my first
¤ dropdownlist control, i load my information in my second dropdownlist.
¤
¤ How i did this is by setting my first dropdownlist (country) to
¤ AutoPostBack=True so that my 2nd dropdownlist is refreshed with it's
¤ content when the SelectedIndexChanged event is fired.
¤
¤ My problem is that my browser refreshes each time to load the second
¤ dropdownlist depending on what choice i made on my first dropdownlist
¤ control.
¤
¤ So I was thinking that there must be a way (in Asp.Net) to load
¤ automatically (without browser's refresh) my second dropdownlist. I know i
¤ could possibly do that in javascript but i want to make it in .Net (if
¤ possible). I am using vb in my aspx files.
¤
¤ Any help, tips, informations, sites, articles is greatly appreciated
¤

The server controls require a trip to the server. If you want to eliminate the trip to the server
then you'll have to use the HTML controls and JavaScript.


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 

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

Top