|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Enabled="False"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. 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 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. >
Server Control to manipulate GridView
Access data in ObjectDataSource no FormView for create/insert page Datagrid custom paging always loads page 1 Validation inside composite controls for ASP .NET 2.0 Datagrid cancel command does not work when adding new record custom button/link in detailsview commandfield section How to set default values for fields in detailsview style question must click button twice for event to fire |
|||||||||||||||||||||||