Posted on: 8/6/2013 2:47:10 AM | Views : 260

How do i cache selected dropdownlist value when being re-binded. I have this function in my dropdownlist box. For example, when a user select an item in dropdownlistbox 1, this item wont re-appear in the other ddl. Unfortunately i got a problem where whenever the user select the default value, it rebind my dropdownlist and refresh the selection i made
this is my fillddllocation method where i query the database
protected void FillddlLocations() { FillDropdown(ddlpid1); FillDropdown(ddlpid2); FillDropdown(ddlpid3); FillDropdown(ddlpid4); FillDropdown(ddlpid5); ddlpid1.Visible = false; ddlpid2.Visible = false; ddlpid3.Visible = false; ddlpid4.Visible = false; ddlpid5.Visible = false; } protected void FillDropdown(DropDownList ddl) { using (var connAdd = new SqlConnection("Data Source = localhost; Initial Catalog = MajorProject; Integrated Security= SSPI")) { connAdd.Open(); var sql = "Select policeid from ...

Go to the complete details ...