Cannot select multiple items in a dropdownlist
My C# ASP.NET web site has a weird problem.
I set a selected value for a dropdownlilst based on a value from a stored
procedure output parameter like this:
this.myDropDown.SelectedValue =
cmd.Parameters["@SourceID"].Value.ToString().Trim();
For some reason, I get a "Cannot have multiple items selected in a
dropdownlist" error on this line of code. I've stepped through the code
and searched for other references to this dropdownlist, commented the
references out, and tried again.
Nope, still doesn't work.
The only way the page works is if I comment out the above line of code.
Any ideas why this would be a problem?
SourceID is always an integer and exists in the list of selections. I've
verified (by stepping through the code) that the selectedValue is always
numeric, and never changes between the time this line executes and the
time the page finishes loading.
Thoughts?
No comments:
Post a Comment