By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,190 Members | 765 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,190 IT Pros & Developers. It's quick & easy.

Setting the web control textbox property enabled = FALSE

P: n/a
After setting the web control text box enable property to FALSE makes the
control to loose the data between round trip. I am making sure that the
property - EnableViewState = TRUE.

Same code when the text box Enable property set to TRUE retains the value.
Please advice.

-Gill
Nov 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hi,

this is related to the HTML standard. Setting Enabled to False on form
control renders it as disabled HTML element (in case of TextBox, <input
type="text" disabled="disabled"...>). And disabled element's value is not
posted with the form. Take a look at:
http://www.w3.org/TR/REC-html40/inte...html#h-17.12.1

By the way, having ViewState enabled or disabled with TextBox has no impact
on TextBox keeping the value, even if it would be disabled as it doesn't use
ViewState to keep the value over postback. More info about that:
http://blogs.aspadvice.com/joteke/ar...03/15/767.aspx

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
http://blogs.aspadvice.com/joteke


"Gill Smith" <gi*******@hotmail.com> wrote in message
news:OX****************@TK2MSFTNGP12.phx.gbl...
After setting the web control text box enable property to FALSE makes the
control to loose the data between round trip. I am making sure that the
property - EnableViewState = TRUE.

Same code when the text box Enable property set to TRUE retains the value.
Please advice.

-Gill

Nov 18 '05 #2

P: n/a
I want to skip the tabbing navigation for the text box.
How to do that ? Making read only property is not helpfull.
Gish

"Teemu Keiski" <jo****@aspalliance.com> wrote in message
news:O2**************@TK2MSFTNGP11.phx.gbl...
Hi,

this is related to the HTML standard. Setting Enabled to False on form
control renders it as disabled HTML element (in case of TextBox, <input
type="text" disabled="disabled"...>). And disabled element's value is not
posted with the form. Take a look at:
http://www.w3.org/TR/REC-html40/inte...html#h-17.12.1

By the way, having ViewState enabled or disabled with TextBox has no impact on TextBox keeping the value, even if it would be disabled as it doesn't use ViewState to keep the value over postback. More info about that:
http://blogs.aspadvice.com/joteke/ar...03/15/767.aspx

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
http://blogs.aspadvice.com/joteke


"Gill Smith" <gi*******@hotmail.com> wrote in message
news:OX****************@TK2MSFTNGP12.phx.gbl...
After setting the web control text box enable property to FALSE makes the control to loose the data between round trip. I am making sure that the
property - EnableViewState = TRUE.

Same code when the text box Enable property set to TRUE retains the value. Please advice.

-Gill


Nov 18 '05 #3

P: n/a
You could manually store the text value in the ViewState yourself, leave
the textbox disabled, and then manually restore the value from ViewState
on postback.

Or ... you might be able to wire to the textbox's change event, and then
just reset it to the old value there. Not sure about that one.

-Jason

Gish Smith wrote:
I want to skip the tabbing navigation for the text box.
How to do that ? Making read only property is not helpfull.
Gish

"Teemu Keiski" <jo****@aspalliance.com> wrote in message
news:O2**************@TK2MSFTNGP11.phx.gbl...
Hi,

this is related to the HTML standard. Setting Enabled to False on form
control renders it as disabled HTML element (in case of TextBox, <input
type="text" disabled="disabled"...>). And disabled element's value is not
posted with the form. Take a look at:
http://www.w3.org/TR/REC-html40/inte...html#h-17.12.1

By the way, having ViewState enabled or disabled with TextBox has no


impact
on TextBox keeping the value, even if it would be disabled as it doesn't


use
ViewState to keep the value over postback. More info about that:
http://blogs.aspadvice.com/joteke/ar...03/15/767.aspx

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
http://blogs.aspadvice.com/joteke


"Gill Smith" <gi*******@hotmail.com> wrote in message
news:OX****************@TK2MSFTNGP12.phx.gbl.. .
After setting the web control text box enable property to FALSE makes
the
control to loose the data between round trip. I am making sure that the
property - EnableViewState = TRUE.

Same code when the text box Enable property set to TRUE retains the
value.
Please advice.

-Gill



Nov 18 '05 #4

P: n/a
Instead of all these steps is there any way I can skip tab stop on the text
box. I want to skip the tab sequense on this control. Disabling the control
is stopping the tab stop but will loose the data between trips.
Thanks for your advice.
"Jason DeFontes" <ja***@defontes.com> wrote in message
news:uC*************@TK2MSFTNGP10.phx.gbl...
You could manually store the text value in the ViewState yourself, leave
the textbox disabled, and then manually restore the value from ViewState
on postback.

Or ... you might be able to wire to the textbox's change event, and then
just reset it to the old value there. Not sure about that one.

-Jason

Gish Smith wrote:
I want to skip the tabbing navigation for the text box.
How to do that ? Making read only property is not helpfull.
Gish

"Teemu Keiski" <jo****@aspalliance.com> wrote in message
news:O2**************@TK2MSFTNGP11.phx.gbl...
Hi,

this is related to the HTML standard. Setting Enabled to False on form
control renders it as disabled HTML element (in case of TextBox, <input
type="text" disabled="disabled"...>). And disabled element's value is notposted with the form. Take a look at:
http://www.w3.org/TR/REC-html40/inte...html#h-17.12.1

By the way, having ViewState enabled or disabled with TextBox has no


impact
on TextBox keeping the value, even if it would be disabled as it doesn't


use
ViewState to keep the value over postback. More info about that:
http://blogs.aspadvice.com/joteke/ar...03/15/767.aspx

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
http://blogs.aspadvice.com/joteke


"Gill Smith" <gi*******@hotmail.com> wrote in message
news:OX****************@TK2MSFTNGP12.phx.gbl.. .

After setting the web control text box enable property to FALSE makes


the
control to loose the data between round trip. I am making sure that the
property - EnableViewState = TRUE.

Same code when the text box Enable property set to TRUE retains the


value.
Please advice.

-Gill


Nov 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.