473,772 Members | 3,148 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Setting the web control textbox property enabled = FALSE

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
4 3587
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="disab led"...>). 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*******@hotm ail.com> wrote in message
news:OX******** ********@TK2MSF TNGP12.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
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****@aspalli ance.com> wrote in message
news:O2******** ******@TK2MSFTN GP11.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="disab led"...>). 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*******@hotm ail.com> wrote in message
news:OX******** ********@TK2MSF TNGP12.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
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****@aspalli ance.com> wrote in message
news:O2******** ******@TK2MSFTN GP11.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="disab led"...>). 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*******@hotm ail.com> wrote in message
news:OX****** **********@TK2M SFTNGP12.phx.gb l...
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
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******** *****@TK2MSFTNG P10.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****@aspalli ance.com> wrote in message
news:O2******** ******@TK2MSFTN GP11.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="disab led"...>). 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*******@hotm ail.com> wrote in message
news:OX****** **********@TK2M SFTNGP12.phx.gb l...

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4760
by: Ahmed Jewahar | last post by:
Dear All, I have about 31 ASP.TextBox controls on my WebForm. The name pattern of the TextBox are as follows: "TextBox1", "TextBox2"...."TexBox31". I want to disable some of them dynamically. I have done the same in ASP. But, i don't know how to in ASP.NET. Following are my code which done in ASP:
21
9923
by: | last post by:
Hi, I am setting the NumericUpDown .Value property and the ValueChanged event is NOT being fired. Does this ONLY get fired when I change it on the UI and not programatically? Thanks
7
2875
by: A.M | last post by:
Hi, I have a validation control in my page that upon any invalid data, it disables all buttons in the page. basicly i don't have any postback in the page if the validator finds any error. How can have the validator just disable certain control's postback and other part of page continue their functionality. Thanks,
5
6935
by: Robert Phillips | last post by:
I have a Panel control containing a few TextBox controls. The Panel is originally enabled, I enter data into the TextBox controls. When I submit, the Panel is disabled during the PostBack and the TextBox controls render greyed-out, and I can see the values in the TextBox controls....this is what I expected. I submit again, the Panel is enabled during the PostBack. All of the TextBox controls within the Panel are now enabled, however,...
1
6428
by: ratnakarp | last post by:
Hi, I have a search text box. The user enters the value in the text box and click on enter button. In code behind on button click i'm writing the code to get the values from the database and binding it to a repeater control. This repeater control has multiple text boxes and buttons. Can you please tell me how can i do paging in this case ? I'm posting my code below. The problem is that if i click on "AdjustThisAd" button, it opens...
2
2241
by: fabrice | last post by:
Hi, I have a trouble with my TextBox Control and it's ViewState in my form... The property for it, is FALSE as following : <form id="frmSearchBre4" runat="Server"> <asp:textbox id="myID" TabIndex="1" EnableViewState="false" MaxLength="50" runat="server" TextMode="SingleLine"> </asp:textbox>
2
5296
by: rn5a | last post by:
Assume that a user control has a TextBox (Page1.ascx) <asp:TextBox ID="txtName" runat="server"/> I am encapsulating the above user control in a ASPX page named Page1.aspx i.e. the ASPX page displays a single TextBox. There's also a CheckBox in this ASPX page within the <formtags. Note that the CheckBox IS NOT a part of the user control. It has been explicitly added to the Form existing in the ASPX page. The AutoPostBack property of...
7
6186
by: Academic | last post by:
What are the different effects of the following two statements: C1.Cursor = Cursors.WaitCursor C1.Cursor.Current = Cursors.WaitCursor I believe the first replaces the entire C1.Cursor object with a new one while the second only replaces the Current object of C1.Cursor, but I can't
7
2016
by: Naveen | last post by:
I posted this message to another board and have hardly had any views on it, leave alone answers. So I am cross-posting here. This may be a very simple question but I can't get my head around it. I have a textbox's enabled property bound to the IsNew property of an object. this.txtPhone1.DataBindings.Add("Enabled", this.BindingSource, "IsNew", true); So when the IsNew property is true, my textbox is enabled. This is correct
0
9620
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10261
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10104
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9912
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7460
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.