Help on dropdown list

Posted by Vijayar under ASP.NET on 5/4/2011 | Points: 10 | Views : 1248 | Status : [Member] | Replies : 2
hi
I have one dropdown i.e country,i want to bind the values of both countries and states to it.and on clicking on save button state name should be save in states tables,and country in country table.how to perform this action .explain with with spilt function with an example
The data should look like
India
Andhrapradesh
USA
mexico
Washington

vijaya


Responses

Posted by: Lokesh76 on: 5/4/2011 [Member] Starter | Points: 25

Up
0
Down
I think you want to show data like
India
State1
State2
State3
.....
Next Country
State1
State2
You need to run the loop on country for populate the dropdown for every country get states and populate all state for that country
Note: when adding the value field then put the value in "CountryCode|StateCode" format. When user click on saved button you get Country and state code both with "|" seperated.

Hope it will solve your problem...

Thanks
Lokesh Kumar

Vijayar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vijayar on: 5/4/2011 [Member] Starter | Points: 25

Up
0
Down
Exactly Please Help me with an example if possible

vijaya

Vijayar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response