void locationCity(string countryCode) { DataTable dt; Classes.Locations l = new Classes.Locations(); dt = l.citiesList(countryCode); DropDownListCity.Items.Clear(); DropDownListCity.Items.Add(new ListItem("Select City", "0")); for (int i = 0; i < dt.Rows.Count; i++) { DropDownListCity.Items.Add(new ListItem(dt.Rows[i]["CityName"].ToString(), dt.Rows[i]["LocationId"].ToString())); } }
protected void DropDownListCountry_SelectedIndexChanged(object sender, EventArgs e) { DataTable dt; Classes.Locations l = new Classes.Locations(); dt = l.citiesList(DropDownListCountry.SelectedValue); DropDownListCity.Items.Clear(); DropDownListCity.Items.Add(new ListItem("Select City", "0")); for (int i = 0; i < dt.Rows.Count; i++) { DropDownListCity.Items.Add(new ListItem(dt.Rows[i]["CityName"].ToString(), dt.Rows[i]["LocationId"].ToString())); } }
void locationCity(int stateId) { DataTable dt; Classes.Locations l = new Classes.Locations(); dt = l.citiesList(Convert.ToInt32(DropDownListState.SelectedValue)); List <System.Web.UI.WebControls.ListItem> states = new List <System.Web.UI.WebControls.ListItem>(); DropDownListCity.Items.Clear(); DropDownListCity.Items.Add(new ListItem("Select City", "0")); for (int i = 0; i < dt.Rows.Count; i++) { DropDownListCity.Items.Add(new ListItem(dt.Rows[i]["CityName"].ToString(), dt.Rows[i]["CityId"].ToString())); } }
void locationCity(string countryCode) { DataTable dt; Classes.Locations l = new Classes.Locations(); dt = l.citiesList(DropDownListCountry.SelectedValue); DropDownListCity.Items.Clear(); DropDownListCity.Items.Add(new ListItem("Select City", "0")); for (int i = 0; i < dt.Rows.Count; i++) { DropDownListCity.Items.Add(new ListItem(dt.Rows[i]["CityName"].ToString(), dt.Rows[i]["LocationId"].ToString())); } }
protected void DropDownListState_SelectedIndexChanged(object sender, EventArgs e) { DataTable dt; Classes.Locations l = new Classes.Locations(); dt = l.citiesList(Convert.ToInt32(DropDownListState.SelectedValue)); List<System.Web.UI.WebControls.ListItem> states = new List<System.Web.UI.WebControls.ListItem>(); DropDownListCity.Items.Clear(); DropDownListCity.Items.Add(new ListItem("Select City", "0")); for (int i = 0; i < dt.Rows.Count; i++) { DropDownListCity.Items.Add(new ListItem(dt.Rows[i]["CityName"].ToString(), dt.Rows[i]["CityId"].ToString())); } }
void locationCity(int stateId) { DataTable dt; Classes.Locations l = new Classes.Locations(); dt = l.citiesList(stateId); List<System.Web.UI.WebControls.ListItem> states = new List<System.Web.UI.WebControls.ListItem>(); DropDownListCity.Items.Clear(); DropDownListCity.Items.Add(new ListItem("Select City", "0")); for (int i = 0; i < dt.Rows.Count; i++) { DropDownListCity.Items.Add(new ListItem(dt.Rows[i]["CityName"].ToString(), dt.Rows[i]["CityId"].ToString())); } }