Posts Tagged ‘selected’
cannot have multiple items selected in a dropdownlist
Posted by: admin in .NET, ASP.Net, Compiler Errors And Messages on March 3rd, 2010
This error occurs when you set the Selected property of the dropdownlist control and there’s already selected item , example.
dropdownlist.Items.FindByValue(“value”).selected = True
or
dim lst as listitem
lst = dropdownlist.Items.FindByText(“textvalue”)
lst.selected = True
To solve this problem, before you call the above code you need to clear the selection in the dropdownlist.
To clear the selection
dropdownlist.ClearSelection();