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 concept of view state in asp.net?

760


Tell me what is the request flow used for asp.net mvc framework? : asp.net mvc

768


Will the asp.net validators run in server side or client side? How do you do client-side validation in .net? How to disable validator control by client side javascript?

735


Explain the difference between debug.write and trace.write? When should each be used?

749


if i wanna deploy my asp.net project to the production server and situation is that i m still not compiled my project i have as-is on my development side now on production server we dont have a visual studio now what kind of settings i need to be to do in webconfig /machine.config file to deploy my project and in iis too....

1823


Is it true that a Web service must be written in .NET or not?

804


What is the default Orientation property in a Menu control?

744


Why and where this web.config file is used?

775


How can you send an email message from an asp.net web page?

690


What are the advantages of asp.net?

721


What permissions do asp.net applications posses by default?

815


How will you do Redo and Undo in a TextControl?

852


Explain asp.net mvc request life cycle? : asp.net mvc

659


What are the different types of validation controls in asp.net?

737


What is fulltrust?

762