R
RSH
Hi,
I am having this very bizarre occurance with 4 dropdown lists on my ASP .Net
page.
Each control has its own unique id. When the user selects a value from each
of the dropdownlists it is written correctly to the database.
HOWEVER...When setting the SelectedIndex property of each of the controls in
the codebehind (.net 1.1) I get an exception "A dropdownlist can not have
multiple selections." This is very odd because I am literally seeting each
control as follows:
ddlActionRequestedBy.Items(2).Selected = True
ddlActionAuthorizedBy.Items(7).Selected = True
ddlActionCompletedBy.Items(12).Selected = True
ddlActionAssignedTo.Items(80).Selected = True
So I stepped through the code to try and see what happens...and what happens
is that when I set the Selected property to true for one control all of the
controls assume the same SelectedIndex. So to verify my assumption I
commented out all but the first "ddlActionRequestedBy.Items(2).Selected =
True" so I would have expected that only that control have a value selected
on page load...BUT to my surprise each of the 4 dropdownlists had the SAME
selected value. I have triple checked all code and nowhere else on the page
am I setting selectedvalues...i dont get it.
What am I missing????
Thanks!
Ron
I am having this very bizarre occurance with 4 dropdown lists on my ASP .Net
page.
Each control has its own unique id. When the user selects a value from each
of the dropdownlists it is written correctly to the database.
HOWEVER...When setting the SelectedIndex property of each of the controls in
the codebehind (.net 1.1) I get an exception "A dropdownlist can not have
multiple selections." This is very odd because I am literally seeting each
control as follows:
ddlActionRequestedBy.Items(2).Selected = True
ddlActionAuthorizedBy.Items(7).Selected = True
ddlActionCompletedBy.Items(12).Selected = True
ddlActionAssignedTo.Items(80).Selected = True
So I stepped through the code to try and see what happens...and what happens
is that when I set the Selected property to true for one control all of the
controls assume the same SelectedIndex. So to verify my assumption I
commented out all but the first "ddlActionRequestedBy.Items(2).Selected =
True" so I would have expected that only that control have a value selected
on page load...BUT to my surprise each of the 4 dropdownlists had the SAME
selected value. I have triple checked all code and nowhere else on the page
am I setting selectedvalues...i dont get it.
What am I missing????
Thanks!
Ron