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

Tell something about state management in asp.net?

3 Answers   Accenture,


Which type of state management is provided by Query String in ASP.NET?

0 Answers   Sans Pareil IT Services,


how to get the vb6.0 COM Component in to the .Net application?

3 Answers   iSoft,


How to make sure that contents of an updatepanel update only when a partial postback takes place (and not on a full postback)?

0 Answers  


Can we have multiple web config files for an asp.net application?

0 Answers  






what is NET Framework ?

4 Answers   TCS,


What are Caching techniques in .NET

0 Answers   Microsoft,


Which is better php or asp.net?

0 Answers  


Can you explain architecture of your project ?

0 Answers  


What are the events in a page life cycle?

0 Answers  


what is silverlight and what is the purpose of silverlight?

2 Answers   Cognizant, CTS,


How to Insert a TextBox value in to Sql database using C# coding?

17 Answers   HCL, Sona, TCS,


Categories