Dropdown list issue binding [Resolved]

Posted by Self-Innovator under ASP.NET on 10/22/2012 | Points: 10 | Views : 829 | Status : [Member] | Replies : 1
I've my drop down list controls Country,State,City
public void FillCountrys()
{
dt = ad.fillcountry();
dropNativeCountry.DataSource = dt;
dropLivingCountry.DataSource = dt;
dropNativeCountry.DataTextField = "StateName";
dropLivingCountry.DataTextField = "StateName";
dropNativeCountry.DataValueField = "id";
dropLivingCountry.DataValueField = "id";
dropNativeCountry.DataBind();
dropLivingCountry.DataBind();
dropNativeCountry.Items.Insert(0, new ListItem("Select"));
dropLivingCountry.Items.Insert(0, new ListItem("Select"));
}

While selecting the country i'm unable to get the countryCOde to list the sepcific states
protected void dropNativeCountry_SelectedIndexChanged(object sender, EventArgs e)
{
FillStates(Convert.ToInt32(dropNativeCountry.SelectedValue.ToString()));
}


If i omit these lines from Binding dropNativeCountry it wrks fine
dropNativeCountry.Items.Insert(0, new ListItem("Select"));
dropLivingCountry.Items.Insert(0, new ListItem("Select"));


Join Hands Change lives
Thanks & Regards
Straight Edge Society



Responses

Posted by: Self-Innovator on: 10/22/2012 [Member] Bronze | Points: 25

Up
0
Down

Resolved
Resolved

Join Hands Change lives
Thanks & Regards
Straight Edge Society

Self-Innovator, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response