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. Advertising

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:
    360
    Suhail A, Salman
    Aug 13, 2003
  2. xenophon

    HtmlSelect and PostBack?

    xenophon, Mar 7, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    1,932
    Sylvain Lafontaine
    Mar 7, 2005
  3. BK
    Replies:
    10
    Views:
    721
  4. =?Utf-8?B?S2Vu?=

    Problem with HTMLSelect

    =?Utf-8?B?S2Vu?=, Nov 18, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    463
    Brock Allen
    Nov 18, 2005
  5. Replies:
    1
    Views:
    1,590
    =?Utf-8?B?QXVndXN0aW4gUHJhc2FubmE=?=
    Aug 25, 2006
Loading...

Share This Page