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

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / 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

More ASP.NET Interview Questions

Every Validation controls have same option ?

2 Answers   iGate,


How to find last error which occurred in Asp.net ?

0 Answers  


Describe the difference between inline and code behind - which is best in?

0 Answers  


What is Response.Flush method ?

3 Answers   Keane India Ltd,


How do you open a page in a new window?

0 Answers  






What is asynchronous call?

0 Answers  


Explain the differences between Server-side and Client-side code?

12 Answers   Cognizant, CTS, Siebel Systems, Visual Soft,


What are the disadvantages of view state / what are the benefits?

2 Answers   Siebel Systems,


Is asp.net easy to learn?

0 Answers  


how to update data using store procedure

1 Answers  


What is the difference between rest and restful?

0 Answers  


What is the difference between Postback and Ispostback Property?

7 Answers   Atrocity Apps Technologies, DC Infotech, HCL, Maples, Visual Soft,


Categories