H
Harry Keck
I have an HTMLSelect declared with the runat=server tag and a code behind
declaration. Normally, when I cause the page to postback with a submit
button, I can test the SelectedIndex property of the HTMLSelect in my code
behind to determine its value. However, if I set the disabled property to
true from client script on the HTMLSelect before the page posts back to the
server, the SelectedIndex always returns 0 in my code behind, no matter what
value is actually selected. After the post is finished and the page
re-renders, it visibly has the correct option selected. Any subsequent
postbacks continue to show SelectedIndex set to 0 in the code behind. Even
if I change disabled to false before posting back, if I have had it set to
true at any point, I also get SelectedIndex of 0. Is this a bug or a feature
of .Net or what? Any suggestions on work arounds?
declaration. Normally, when I cause the page to postback with a submit
button, I can test the SelectedIndex property of the HTMLSelect in my code
behind to determine its value. However, if I set the disabled property to
true from client script on the HTMLSelect before the page posts back to the
server, the SelectedIndex always returns 0 in my code behind, no matter what
value is actually selected. After the post is finished and the page
re-renders, it visibly has the correct option selected. Any subsequent
postbacks continue to show SelectedIndex set to 0 in the code behind. Even
if I change disabled to false before posting back, if I have had it set to
true at any point, I also get SelectedIndex of 0. Is this a bug or a feature
of .Net or what? Any suggestions on work arounds?