asp.net - How to generate a dropdown list from another? -


i want generate drop down list drop down list. have dropdown of countries. when selecting country,another dropdown must come values states of specific country. how in asp.net using c#?

for each country have, add new list item drop down list, text country , value id of country. on second drop down list, set auto post property true , add event on selected item change. in event code, selected item , second ddl. try it!

tip: add hidden field on page, , on selected item changed event first ddl, set value of hidden field, selected value. on page_load event, verify if value string.empty , if id in value. if is, bind second ddl.


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -