Asp.NET DropDownList Resets SelectedIndex after PostBack Asp.NET DropDownList Resets SelectedIndex after PostBack asp.net asp.net

Asp.NET DropDownList Resets SelectedIndex after PostBack


Add AppendDataBoundItems="true" for dropdown list


I discovered the problem. The values being populated from my SQL statement contained values that repeated. For some reason this was causing the entire thing to malfunction in weird ways which made it so that every time I selected a ListItem the whole list would reset. By making sure no values repeated, the code started working perfectly. Thanks for everyone's help.


Make sure that your value fields are unique for each dropdown list item. If each item has the same value, it will default on index 0.