EnableViewState

J

JohnZing

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 have the EnableViewState="False" in the control tag

<asp:TextBox id="txtMsg" runat="server" MaxLength="300" Rows="4"
Columns="60" TextMode="MultiLine"
EnableViewState="False"></asp:TextBox>

but... asp.net keeps the txtMsg text between postbacks... why?

Thanks for any help
 
S

Scott M.

Textboxes do not use ViewState to maintain their values across postbacks
(neither do any Web Form control that has the ability to have a default
value set).

These controls simply post their values as normal to the server and then the
server simply takes that value and makes it be the default value of the new
control generated for the postback. You can see this if you view the source
code of the page after the initial form submission, the textbox will have a
'value' attribute set to the data entered into the textbox when it was
submitted.
 

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,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top