Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8432235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:04:28+00:00 2026-06-10T06:04:28+00:00

When EnableViewstate = false and I do postback, my textbox control retains the text

  • 0

When EnableViewstate = false and I do postback, my textbox control retains the text value but label control does not. I am changing the text for both label and textbox on a button’s click event.

protected void Button1_Click(object sender, EventArgs e)
{
    TextBox1.Text = "Message Changed";
    Label1.Text = "Message Changed";
}

There is another button my page for just postback.

Also if I do no need viewstate for this control, then is there a list of all the controls that don’t need the viewstate?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T06:04:29+00:00Added an answer on June 10, 2026 at 6:04 am

    All controls which implement IPostBackDataHandler load their values even if ViewState is off. Note that events like TextChanged and other properties like ForeColor don’t work when ViewState is disabled.

    Here’s a list of controls which implement IPostBackDataHandler

    • CheckBox
    • CheckBoxList
    • DropDownList
    • HtmlInputCheckBox
    • HtmlInputFile
    • HtmlInputHidden
    • HtmlInputImage
    • HtmlInputRadioButton
    • HtmlInputText
    • HtmlSelect
    • HtmlTextArea
    • ImageButton
    • ListBox
    • RadioButtonList
    • TextBox

    Why textbox persists data during postback even if View State set to off

    Whenever a page is submitted or posted back to server, the entire form
    data is posted to the server as a collection with the request. The
    collection is in the form of NamedValue collection and this collection
    has the mapping with uniqueid of the control and the value of the
    control. You can read the data from the form collection by using the
    following code snippet

    //Reading textbox value from the form collection 
    string textboxvalue = Request.Form[textbox1.UniqueID];
    

    ASP.NET uses this primitive to update the control’s value. ASP.NET
    uses IPostBackDataHandler for the controls that load the data from
    the form collection.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the page directive of my page I have set EnableViewState=false. But I am
I have a Repeater control in my aspx page: <asp:Repeater ID=repeater runat=server EnableViewState=false> <ItemTemplate>
I have next code, <form id=form1 runat=server> <asp:Label runat=server ID=Label1 EnableViewState=false /> <asp:CheckBox runat=server
What does EnableViewState on a HyperLink do or mean? <asp:HyperLink ID=RegisterHyperLink runat=server EnableViewState=false>Register</asp:HyperLink> What
How is a TextBox able to persist changes (e.g. text) even after the EnableViewState
Put a textbox, a checkbox and a button on a website. Set the EnableViewState
if i set EnableViewState=false then also input data is maintain after postback at the
Was the new ViewStateMode property introduced to avoid breaking the existing EnableViewState? Does setting
<div runat=server enableviewstate=false> <div runat=server enableviewstate=false></div> </div> What happends if I won't set the
I have two very similar .aspx pages. Both of them contain a DropDownList control.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.