What does the "EnableViewState" property do? Why would I
want it on or off?

Answer Posted / swapna

Enable ViewState turns on the automatic state management
feature that enables server controls to re-populate their
values on a round trip without requiring you to write any
code.

This feature is not free however, since the state of a
control is passed to and from the server in a hidden form
field.

You should be aware of when ViewState is helping you and
when it is not. For example, if you are binding a control
to data on every round trip, then you do not need the
control to maintain it's view state.

ViewState is enabled for all server controls by default. To
disable it, set the EnableViewState property of the control
to false.

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which method is used to force all the validation controls to run?

781


How to find last error which occurred?

768


Which two new properties are added in asp.net 4.0 page class?

708


Explain the difference between codebehind="mycode.aspx.cs" and src="mycode.aspx.cs"?

735


Write a code snippet to implement the indentation in json in web api.

783


What is application state?

689


What are the three parts of an http response?

705


When was asp.net released?

750


What is base class of .net?

740


Define page output caching?

751


Which is the parent class of the web server control?

789


How would you turn off cookies on a page of a website?

680


What is the difference between page directive include and action tag include?

717


How can we create pie chart in asp.net?

810


Is it right that ASP.NET Web API has replaced WCF?

720