J
Jacques
Platform: .Net v2.0 Asp.net
Scenario: Three dropdownlist controls on a user control. In consecutive
order they are Countries, Regions, Cities. Countries is loaded during OnInit
and the other two are left disabled. Once the user selects a country, the
regions list is populated. Once a region is selected the cities list is
loaded.
Problem: When it comes to the page life cycle, there doesn't seem to be an
appropriate place to put the code to load the second and third list. To load
the list of regions you need the selected value of the countries
dropdownlist. You will only have this information during and after OnLoad.
It will work to load the list of Regions at this point, but viewstate and
postback data will no longer work, because it has already been processed by
the time the list is attempting to load.
Question: What is the best way to achieve this kind of cascading
dropdownlist whilst keeping the page life cycle happy?
Thanks
Scenario: Three dropdownlist controls on a user control. In consecutive
order they are Countries, Regions, Cities. Countries is loaded during OnInit
and the other two are left disabled. Once the user selects a country, the
regions list is populated. Once a region is selected the cities list is
loaded.
Problem: When it comes to the page life cycle, there doesn't seem to be an
appropriate place to put the code to load the second and third list. To load
the list of regions you need the selected value of the countries
dropdownlist. You will only have this information during and after OnLoad.
It will work to load the list of Regions at this point, but viewstate and
postback data will no longer work, because it has already been processed by
the time the list is attempting to load.
Question: What is the best way to achieve this kind of cascading
dropdownlist whilst keeping the page life cycle happy?
Thanks