In My asp.net(with C#) Application I Have States DropdownList and Districts Dropdownlist ..and when i select the state corresponding district should come in the district dropdownlst..
Plz Suggest some Solution for this,,,,
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Pankaj PandeyPosted May 30, 2013, 7:07 AM
hello
http://www.codeproject.com/Articles/38231/Simple-Way-to-Implement-Country-State-City-Dropdow
http://www.c-sharpcorner.com/uploadfile/rohatash/dropdownlist-with-country-state-and-city-in-asp-net/
try it .
Sathish PabbathiPosted May 30, 2013, 4:04 AM
divyaPosted May 30, 2013, 2:39 AM
In states dropdown select index changed event, bind the data to district dropdown as given below
Jay ParekhPosted May 30, 2013, 2:38 AM
http://www.itorian.com/2013/02/cascading-dropdownlist-in-aspnet-mvc.html
Pankaj PandeyPosted May 30, 2013, 2:30 AM
i hope sates and districts both you are fetching from database tables.
if yes then given solution will work
state table
state_id statename
1 abc
2 def
districts table
districts_id districts state_id/Statename
1 xyz 1
2 hhh 1
3 kkkk 2
you can get districts by following query
select districts from tbl_districts where statename=@statename
when you store state name in citytable
or
select districts from tbl_districts where state_id =(select state_id from tbl_state where statename=@statename)
you need to pass statename to @statename from first ddl.
mark as answered if helpfull