Click here to Skip to main content
15,886,830 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to display city according to country..
means when i change country then in city dropdown display cities which is in that country...
so how can i do???
plz help me..
thanks in advance.
Posted

You can use CascadingDropDown Extender of AjaxControlToolkit to achieve your requirement
Please view on the bellow link

http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/CascadingDropDown/CascadingDropDown.aspx
 
Share this answer
 
v2
There's an event on the dropdownlist called SelectedIndexChanged[^] which fires up when a value has been selected on the control. That event for your Countries control should be existing on your code behind as that is where you will put the logic for retrieving the cities from your database. I assume you have a foreign key of the country on your Cities table so the retrieval is pretty straightforward. Also, you need to set Autopostback to true on the HTML/ASP.Net tag of your control so that the event will be fired.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900