Cannot have multiple items selected in a DropDownList

Usually this error occurs when you load your ddl as following:

ddl.FindByValue("parameter").Selected = true; 

To overcome this error, you should clear the previous selection of your ddl as following:

ddl.ClearSelection();
ddl.FindByValue("parameter").Selected = true; 

Or you can do as following:

ddl.SelectedItem = "parameter";

I hope i could help someone. 😉

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)