Problem with HTMLSelect.SelectedIndex and client disabled property

Discussion in 'ASP .Net Web Controls' started by Harry Keck, Jan 27, 2005.

  1. Harry Keck

    Harry Keck Guest

    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?
     
    Harry Keck, Jan 27, 2005
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Suhail A, Salman
    Replies:
    0
    Views:
    433
    Suhail A, Salman
    Aug 13, 2003
  2. =?Utf-8?B?S2Vu?=

    Problem with HTMLSelect

    =?Utf-8?B?S2Vu?=, Nov 18, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    512
    Brock Allen
    Nov 18, 2005
  3. Replies:
    1
    Views:
    1,745
    =?Utf-8?B?QXVndXN0aW4gUHJhc2FubmE=?=
    Aug 25, 2006
  4. RSH
    Replies:
    3
    Views:
    539
  5. Froefel
    Replies:
    0
    Views:
    503
    Froefel
    Jul 24, 2007
  6. Froefel
    Replies:
    0
    Views:
    592
    Froefel
    Jul 25, 2007
  7. Froefel
    Replies:
    0
    Views:
    454
    Froefel
    Jul 25, 2007
  8. =?Utf-8?B?RnJvZWZlbA==?=
    Replies:
    0
    Views:
    514
    =?Utf-8?B?RnJvZWZlbA==?=
    Jul 25, 2007
Loading...