private void BindCountry()
{
ddlCountry.DataSource = CountryList();
ddlCountry.DataTextField = "CountryName";
ddlCountry.DataValueField = "CountryId";
ddlCountry.DataBind();
ddlCountry.Items.Insert(0, new ListItem("Select", "0"));
ddlCity.Items.Insert(0, new ListItem("Select", "0"));
}
private void BindCity()
{
ddlCity.Items.Clear();
int cityid = Convert.ToInt32(ddlCountry.SelectedValue);
ddlCity.DataSource = CityList(cityid);
ddlCity.DataTextField = "CityName";
ddlCity.DataValueField = "CityId";
ddlCity.DataBind();
ddlCity.Items.Insert(0, new ListItem("Select", "0"));
}
protected void ddlCountry_SelectedIndexChanged(object sender, EventArgs e)
{
BindCity();
}