Warning: Undefined array key "url" in /volume1/web_packages/wordpress/wp-content/plugins/wpforms-lite/src/Forms/IconChoices.php on line 124 Warning: Undefined array key "path" in /volume1/web_packages/wordpress/wp-content/plugins/wpforms-lite/src/Forms/IconChoices.php on line 125 Error: Cannot have multiple items selected in a DropDownList – Sarmad Aljazrawi

Error: Cannot have multiple items selected in a DropDownList

Receiving this error when trying to select an item in an ASP.NET dropdownlist as below:

Dropdownlist1.items.FindByValue(“1”).Selected = True

To Solve this, just call the ClearSelected method before selecting the item:

Dropdownlist1.ClearSelection()
Dropdownlist1.items.FindByValue(“1”).Selected = True

Add a Comment