1
Answer

Select data field to display in dropdownlist (Id Control)

hi guys
i have 2 tbls are below
1/(RegionTbl).
Region id PK
RegionName Nvarchar
2/ (CityTbl)
CityID
RegionID Fk
CityName Nvarchar Pk
and in application i have 2 dropdownlist , list1 is datasource from RegionTble To select RegionName and list 2 from CityName in order to seletc from list1 regionname to display cities in list2 as afilter data
please give me solution step by step
Answers (1)
0
Manas Mohapatra

Manas Mohapatra

NA 29.3k 3.3m 8y
You need to use Cascading dropdownlist concept here. Means first you need to all records into Region dropdown then onselect of dropdown it will fetch id of region and filter all cities which are belong region(RegionID).Please follow below links that may help you:
 
http://www.aspsnippets.com/Articles/Populate-Cascading-DropDownList-from-Database-in-ASPNet-Example.aspx
 
http://www.aspdotnet-suresh.com/2012/11/country-state-city-cascading.html
 
http://www.codeproject.com/Articles/32725/Using-CascadingDropDown-with-a-Database