Home All Groups Group Topic Archive Search About
Author
12 Apr 2006 1:59 PM
Loren Dummer
If I have a <asp:textbox control on a webform that is sometimes
enabled="False" and sometimes Enabled="True".  How can I still read the
value of the textbox control when the enabled property is set to False?  For
some reason, if the Enabled property is set to True, I cannot read the text
property of the textbox.  It just returns "".  I used to do this all the
time in ASP 3.0 when the <input> control had the disbled command.

Author
16 Apr 2006 8:23 AM
Teemu Keiski
Hi,

Basically, disabled controls won't submit their values to the server so
after you do a postback (when disabled the control) the value is lost.
See: http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.12.1

If you use ASP.NET v2.0, you can make the form to submit disabled controls
http://msdn2.microsoft.com/en-us/library/system.web.ui.htmlcontrols.htmlform.submitdisabledcontrols(VS.80).aspx

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

Show quoteHide quote
"Loren Dummer" <ldum***@isaconsultants.com> wrote in message
news:uV1TVljXGHA.2268@TK2MSFTNGP02.phx.gbl...
> If I have a <asp:textbox control on a webform that is sometimes
> enabled="False" and sometimes Enabled="True".  How can I still read the
> value of the textbox control when the enabled property is set to False?
> For some reason, if the Enabled property is set to True, I cannot read the
> text property of the textbox.  It just returns "".  I used to do this all
> the time in ASP 3.0 when the <input> control had the disbled command.
>