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 8434233
In Process

The Archive Base Latest Questions

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

I wrote a ASP.NET Application and it run in IIS7 of a Server. If

  • 0

I wrote a ASP.NET Application and it run in IIS7 of a Server. If I open this webform in my Browser and show me the Sitecode I see this…

enter image description here

I have many Controls how Buttons,Labels,TextBoxes and a ListView. I try to deactivate ViewState in the web.config but if I deactivate this my Application don’t run correctly. What can I do?

  • 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:36:05+00:00Added an answer on June 10, 2026 at 6:36 am

    Deactivate only the controls that not need the viewstate.

    To do that you need to understand what the viewstate is.

    Viewstate is where the page save and remember the values of the controls to have them after a post back. Remember that, the viewstate is used after a post back.

    So actually you have two times the same data, but only the viewstate is post back the previous data and code behind can be use that data.

    So the main question is, what controls do you need to be remember what you have fill them in, or what controls need to remeber the previous state of them.

    Lets see a simple Literal with EnableViewState on and off.

    ViewState ON

    <asp:Literal runat="server" EnableViewState="true" ID="txtLiterar">
    

    Now if you place a text on this literal the text is also saved on viewstate and on code behind you can do that.

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            txtLiterar.Text = "Hello There";
        }
    }
    

    So after the post back the Literal still have its content, and you can avoid to fill it again, because the viewstate have it and automatically fills it again.

    ViewState OFF

    <asp:Literal runat="server" EnableViewState="false" ID="txtLiterar">
    

    Now if you place a text on this literal the text is not saved on view state and on code behind you add it as.

    protected void Page_Load(object sender, EventArgs e)
    {
        txtLiterar.Text = "Hello There";
    }
    

    So the different is that you need to always fill that control with data on every post.

    Where the viewstate is needed most.

    The most needed part of the viewstate is when you fill a dropdown list. There you have a databind and code behind need to remember the values to place on the SelectValue the correct one.

    Its also needed on GridView and other controls like that because is keep the previous page and other information’s when you paging your data.

    So you can close on most of your controls the viewstate – on that controls that you can fill them again on every post back, and on that controls that not need to remeber the previous state.

    More to read:
    How to optimize class for viewstate
    Determine size of ASP.NET page's viewstate before serving page
    Limiting view state information on AJAX calls

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

Sidebar

Related Questions

I wrote an application using ASP.NET MVC, in this application I have an Index
In a ASP.Net application I have a class. This class need reference to two
i want to use this plugin in my asp.net application i want to show
We have an ASP.NET application that uses SQL Server to store its session state.
I have an ASP.NET MVC application that I wrote using LINQ to communicate with
I have an ASP.NET MVC application, which seems to run OK on my machine,
I have created blank Asp.Net-MVC 3 web application and want to write my own
I wrote an ASP.NET application and am running it on apache with mod mono.
We have an asp.net application that is able to create .air files. To do
I have a wierd problem with threading in an ASP.NET application. For some reason,

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.