hi
i have 2 user controls state and city(both drop downs) when i select state user control all related cities in that state should be filled in city drop down how to do it
please help
Loading
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.
sathish kumarPosted Jun 11, 2012, 7:34 AM
like below[ Set primary key to city name], set autopostback property of both dropdownlist to TRUE
india , chennai
india , bangalore
india, madurai,
india, delhi
usa newyork
usa wasington
china Beijing
Russia Mascow
then fill country names in 1st dropdownlist on page load time....and
double click 1st dropdownlist and write even as
strSQL= select cityname from tablename where country='"+1stDropdownlist.SelectedItem.tosting()+"';
dataReader dr= cmd.executereader();
while(dr.read())
{
citydropdown.Items.Add(dr[0].tostring());
}
}
u can do now i think....
sathish kumarPosted Jun 11, 2012, 7:28 AM
like below[ Set primary key to city name]
india , chennai
india , bangalore
india, madurai,
india, delhi
usa newyork
usa wasington
china Beijing
Russia Mascow
then fill country names in 1st dropdownlist on page load time....and
double click 1st dropdownlist and write even as
select cityname from tablename where country='"+1stDropdownlist.SelectedItem.tosting()+"'
fill t above code next dropdownlist... Hope it will be useful.....
Anil KumarPosted Jun 5, 2012, 4:37 AM
SenthilkumarPosted Jun 5, 2012, 4:33 AM
You need to create the delegate event.
That even should be included in the aspx.cs page, you can enable the auto post back event.
When delegate event written in the current page then you can bind the control based on the selection made in state.