10 pts.
0
Q:
Two dropdownlist select one change data of another list. !hELP ME OUT
Two dropdownlist (drpcountry & drp city). i just want if i select pakistan in drpcountry other dropdownlist which is drpcity should display cities of that country it works for 1st country pk but if i select other the cities drp list dont update and show same old cities. i have true autopostback in both dropdownlist and code is below
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack==false)
{
drpcountry.Items.Add("Pakistan");
drpcountry.Items.Add("Iran");
drpcountry.Items.Add("Dubai");
drpcity.Items.Add("Islamabad");
drpcity.Items.Add("Karachi");
drpcity.Items.Add("Lahore");
}

}

protected void drpcountry_change(object sender, EventArgs e)
{
drpcity.Items.Clear();
if (drpcountry.SelectedItem.Value == "Pakistan")
{
drpcity.Items.Add("Islamabad");
drpcity.Items.Add("Karachi");
drpcity.Items.Add("Lahore");
}

else if (drpcountry.SelectedItem.Value == "Iran")
{
drpcity.Items.Add("Tehran");
drpcity.Items.Add("Muskat");
drpcity.Items.Add("Damishq");
}

else
{
drpcity.Items.Add("Doha");
drpcity.Items.Add("zaibi");
drpcity.Items.Add("inshalla go there");
}

}




}
ASKED: Jun 28 2009  8:49 AM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
10 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
Last Answered: Jun 28 2009  8:49 AM GMT by Shahzeb   10 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



0