Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Problem with HTMLSelect.SelectedIndex and client disabled property

Reply
Thread Tools

Problem with HTMLSelect.SelectedIndex and client disabled property

 
 
Harry Keck
Guest
Posts: n/a
 
      01-27-2005
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?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Client and File and printer sharing auto disabled? Tony Goldstone A+ Certification 0 08-29-2006 04:49 PM
element with 'disabled' property doesnt exist for form processing ? HAlx ASP .Net Web Controls 1 06-08-2005 01:41 PM
"disabled" property for form data Mark Hannon Javascript 5 08-20-2004 03:51 AM
Hashtable Property - Disabled at Design Time? Kevin Williams ASP .Net Web Controls 0 09-26-2003 08:29 PM
property is disabled at design time of my custom control vipul DotNet ASP .Net Building Controls 1 09-15-2003 02:22 PM



Advertisments