473,416 Members | 1,548 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

EnableViewState does not appear to work for asp textboxes?

Hi,

I have the following code which suggests state information
will not be kept for the textbox - but when i submit the
form with textbox1.value ="ABC" and reshow the page it
shows "ABC" instead of "test" i.e. the initial value.

Any idea whats going on here?

Note: This property enableviewstate works ok for a datagrid i.e. if set to
false it does exactly what you expect!
<asp:TextBox id="TextBox1" runat="server"
EnableViewState="False">test</asp:TextBox></P>
Nov 19 '05 #1
2 1598
It's a known issue. Have a look at
http://blogs.aspadvice.com/joteke/ar...03/15/767.aspx

Eliyahu

"John Blair" <jo********@hotmail.com> wrote in message
news:tE**************@newsfe1-gui.ntli.net...
Hi,

I have the following code which suggests state information
will not be kept for the textbox - but when i submit the
form with textbox1.value ="ABC" and reshow the page it
shows "ABC" instead of "test" i.e. the initial value.

Any idea whats going on here?

Note: This property enableviewstate works ok for a datagrid i.e. if set to
false it does exactly what you expect!
<asp:TextBox id="TextBox1" runat="server"
EnableViewState="False">test</asp:TextBox></P>

Nov 19 '05 #2
Thanks alot (again!). Not what i was expecting - makes this feature useless
for this control!

My workaround is:

If Page.IsPostBack Then

TextBox1.Text = "Default"

End If

"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
It's a known issue. Have a look at
http://blogs.aspadvice.com/joteke/ar...03/15/767.aspx

Eliyahu

"John Blair" <jo********@hotmail.com> wrote in message
news:tE**************@newsfe1-gui.ntli.net...
Hi,

I have the following code which suggests state information
will not be kept for the textbox - but when i submit the
form with textbox1.value ="ABC" and reshow the page it
shows "ABC" instead of "test" i.e. the initial value.

Any idea whats going on here?

Note: This property enableviewstate works ok for a datagrid i.e. if set
to
false it does exactly what you expect!
<asp:TextBox id="TextBox1" runat="server"
EnableViewState="False">test</asp:TextBox></P>


Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jason M | last post by:
Hi, Im very new to c#, so forgive me if this is a really stupid question. Im trying to create a form for entering purchase requests. For each line item I have a quantity, a description unit cost...
2
by: Alpha | last post by:
Hi Friends, I am setting EnableViewState property of page and 2 textbox to false but still its retaining the values. After refreshing the page..it is submitting the value in 2 textboxes even the...
9
by: kai | last post by:
Hi, All I create an ASP.NET page, it contains FirstName textbox and LastName textbox. I setup "enableViewState=false" in page directive. When I enter data in FirstName and LastName textbox,...
6
by: Chris | last post by:
I've created two textboxes and one button on my web form. I then set the EnableViewState property of Textbox1 to False. Textbox2 is set to True. The button has no code in it - It simply has an...
6
by: AFN | last post by:
I have a server-side table, <asp:table id="tblData" EnableViewState="true" runat="server" /> and my code-behind adds rows of data to the table in code that says: if not page.ispostback then...
1
by: AC | last post by:
Hello, All Is it possible to set enableViewState='true' for single control on a page with enableViewState='false'. In particular I am interested in DropDownList, but neither using IDE to set...
2
by: Calvin KD | last post by:
Hi everyone, I have a datagrid to display search results. The search results at this stage we only return the first 500 records to speed up the search. The problem is, if I turn the...
3
by: JohnZing | last post by:
I Have EnableViewState="false" in the top of my page has you can see below <%@ Page Language="VB" EnableViewState="false" MasterPageFile="~/MasterPage.master" AutoEventWireup="false...... I...
2
by: teo | last post by:
I have a Listbox, if I set EnableViewStarte = False the AutopostaBack fired by SelectedIndexChanged doesn't work. The 'SelectedIndexChanged' event should call
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.