Google News
logo
ASP.NET - Quiz(MCQ)
What property do you modify on a server control to minimize the size of the ViewState data?
A)
ViewState="true"
B)
Set EnableViewState to true.
C)
Set EnableViewState to false.
D)
None of the Above

Correct Answer :   Set EnableViewState to false.


Explanation : In ASP.NET when a form is postback to server it reappears in the browser with all form values. ASP.NET page and controls maintain their state by in hidden form field named _ViewState. By default it is enable for all server controls and sometimes create problem because unnecessary data are stored in this field. To minimize the size of the ViewState data, set EnableViewState to false.

Advertisement