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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
SenthilkumarRank #387 · 6.5K reputationPosted Jun 5, 2012, 12:33 AM EDT
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.
Anil KumarRank #367 · 6.8K reputationPosted Jun 5, 2012, 12:37 AM EDT
sathish kumar115 reputationPosted Jun 11, 2012, 3:28 AM EDT
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.....
sathish kumar115 reputationPosted Jun 11, 2012, 3:34 AM EDT
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....