EnableViewState does not appear to work for asp textboxes?

J

John Blair

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>
 
J

John Blair

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top