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

Answer Posted / kumar saurabh

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, since you will wipe out any re-populated data in any case. 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 ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the full form of asp.net?

533


What is Web API Routing?

607


Explain exception handling in .net.

616


What is the difference between session and application?

506


By default, Web API sends HTTP response with which of the following status code for all uncaught exception?

971






Where is the session stored?

637


What is use of Master Page in ASP.NET web pages?

627


How to improve performance of web application asp.net mvc? : Asp.Net MVC

495


What are the asp.net 2.0 features?

552


What methods are fired during the page load? Init()

520


How to implement form based authentication in asp.net application?

569


What is a page life cycle?

569


What are the best practices to follow to secure connection strings in an ASP.NET web application?

558


Which method is used to enforce garbage collection in .net?

429


What is the difference between asp.net and mvc?

586