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

  • Home
  • SEARCH
  • 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 7619105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:34:27+00:00 2026-05-31T03:34:27+00:00

In an ASP.NET 4 Web Forms Web Application I want to completely disable ViewState

  • 0

In an ASP.NET 4 Web Forms Web Application I want to completely disable ViewState for a TextBox control. I’ve searched the internet but couldn’t find an answer that solved my problem.

So far I have tried setting the Page directive like this:

EnableEventValidation="false" ViewStateMode="Disabled" EnableViewState="false"

I’ve also set the TextBox control like this:

ViewStateMode="Disabled" EnableViewState="false"

Normally these 2 settings should be enough for disabling ViewState, but it is not.

Then, I wrote the following in the page’s code-behind file:

protected override void SavePageStateToPersistenceMedium(object state) { }

protected override object LoadPageStateFromPersistenceMedium()
{
    return null;
}

This resulted in the ViewState value in the HTML to be null, but when I press the submit button, the value in the TextBox is still remembered by the browser.

How can I disable this functionality?

  • 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-05-31T03:34:28+00:00Added an answer on May 31, 2026 at 3:34 am

    You are misunderstanding how ViewState is used.

    See this article for a full explanation. To quote:

    ViewState is not responsible for the population of values that are
    posted such as by TextBox controls (although it does play an important
    role)

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

Sidebar

Related Questions

I have a ASP.NET Web Forms application and I'm using some dynamic controls in
We recently built a large ASP.NET web forms application for a client and the
I am working on a ASP.Net web forms application which I inherited from a
I have an ASP.NET web application that is using forms authentication. Everything is configured
I am building a Web Application using asp.net (C#). I come from windows forms
I've got an ASP.NET 3.5 Web Forms application in which a large chunk of
I have a web application built in asp.net mvc using forms authentication. I am
I am in the process of migrating an ASP.NET web forms application to ASP.NET
I'm writing a ASP.NET web application. It dosen't use Web Forms or MVC. It
I want to set the application name for my web app in the asp.net

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.