G
Guest
All
I have a .Net 2003 webform, that contains a DropDownList databound to one table, whilst SelectedValue is databound to another table
I discovered that the first time I'd load the page, the selected value was displayed correctly. However, on subsequent loading (ie: IsPostBack was true) the DropDownList always defaulted to the first value
I determined that the DropDownList was empty (of course) on the first loading, but having values already there on subsequent loadings caused the problem. Now I "DropDownList.Items.Clear();" on each reload to empty the list and cause the right value to display
My question is: why does it behave this way? This seems the wrong behaviour, and I'd *really* like to get to the bottom of it
Simon
P.S. I can duplicate the solution if I disable "EnableViewState" and delete "DropDownList.Items.Clear();"
I can duplicate problem by implementing solution, then after "this.DataBind();" adding "DropDownList.DataBind();"
I have a .Net 2003 webform, that contains a DropDownList databound to one table, whilst SelectedValue is databound to another table
I discovered that the first time I'd load the page, the selected value was displayed correctly. However, on subsequent loading (ie: IsPostBack was true) the DropDownList always defaulted to the first value
I determined that the DropDownList was empty (of course) on the first loading, but having values already there on subsequent loadings caused the problem. Now I "DropDownList.Items.Clear();" on each reload to empty the list and cause the right value to display
My question is: why does it behave this way? This seems the wrong behaviour, and I'd *really* like to get to the bottom of it
Simon
P.S. I can duplicate the solution if I disable "EnableViewState" and delete "DropDownList.Items.Clear();"
I can duplicate problem by implementing solution, then after "this.DataBind();" adding "DropDownList.DataBind();"