Posted on: 8/21/2014 11:28:48 AM | Views : 453

I have two dropdowns. First is for State and second is one for the City. When I select the state, its respective city gets populated in the next dropdown. I have one option to add more cities through textbox on button click while selecting the Other option from the city dropdownlist.
The issue is that whenever i am adding the city from the textbox, the it gets inserted into the respective state and also the dropdownlist loses its value. I tried debugging but couldn't find the exact issue.
Please see the code for your reference:
protected void btnAddDropDown_Click1(object sender, EventArgs e) { using (SqlConnection con = new SqlConnection(constring)) { con.Open(); SqlCommand cmd = new SqlCommand(); cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "Add_CityforLocation"; cmd.Parameters.Add("@ID", SqlDbType.VarChar).Value = 0; cmd ...

Go to the complete details ...