During page load, index 0 was already selected. Then this code statement selected index 1:
dropDownList.Items.FindByValue(myValue).Selected = true;
// assume my
I had a similar problem but under a slightly different scenario. I thought I should post it and the resolution here as it may help someone save time if they happen to be in my similar scenario.
First the error message:
AMError: Sys.WebForms.PageRequestManagerServerErrorException:
Sys.WebForms.PageRequestManagerServerErrorException:
Cannot have multiple items selected in a DropDownList.
My Scenario:
I was using using VisualStudio 2010 to step through the application (ASP VB Net) when I encountered the problem. I looked over the 2 dropdownlists
on the page, checked the internet and wasted several hours w/o any resolution.
Resolution:
Then I got feedup and exited VS 2010 and took a break. When I came back. I reran the application and there was no problem. That's when I realized my costly mistake: I had setup an expression that set the
SelectedValue
in the Debugger Watch Window! Hence the multiplicity!
I removed the expression and all was well again --- Visual Studion 2010 able to get past the dropdownlist
section onto the another area of focus of the application.