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

Which class provides methods that can be used to manage role membership to be used in user authorization?

3 Answers   Wipro,


can i use two web.config files of ConnectionString in One Default.aspx page

6 Answers   Satyam, Verinon Technology Solutions, Wipro,


what is differences between bind and eval?

2 Answers  


What is http only cookie?

0 Answers  


Descrie about response.buffer and repsonse.flush ?

2 Answers   ADP, Cognizant,






what is Satellite Assembly?

2 Answers  


What are generics? why it is used? architecture of ASP.NET?

7 Answers   Path Infotech, Satyam, TCS,


What are the various ways to send content from one page to another?

0 Answers  


Define state managenent?Descibe state managenent technique which maintain the information at server site focusing it IDS features and limitations?

1 Answers  


Describe state management in asp.net?

0 Answers  


Explain difference between friend and protected friend?

0 Answers  


how to edit gridview control in asp.net2.0

1 Answers   3i Infotech,


Categories