I have several dropdown boxes and cancel box. If user did
not make a selection from dropdown box, instead directly click cancel box. I
got the error:
GID had a selectedIndex which is invalid because it does not
exist in the list of theItems. Parameter name: value
Here is my code:
protected void
Cancel_Click(object sender, EventArgs e)
{
PID.SelectedIndex
= 0;
GID.SelectedIndex
= 0;
Tid.SelectedIndex
= 0;
sid.SelectedIndex
= 0;
}
How to prevent this error?
Thank you very much.
...
Go to the complete details ...