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

What is considered a service provider?

0 Answers  


How do we invoke queries from the application?

3 Answers   Microsoft,


Types of object in asp ?

1 Answers   Accenture,


How can you change a Master page dynamically in which event of page life cycle?

2 Answers   Fulcrum Logic,


What are the contents of cookie?

0 Answers  






How Session use Cookies in State Management?

0 Answers  


Why mvc is faster than asp.net? : Asp.Net MVC

0 Answers  


How do you handle session management in ASP.NET and How do you implement them. How do you handle in case of SQLServer mode?

1 Answers   DELL, Microsoft,


What is the difference between pathparam and queryparam?

0 Answers  


What are the various session state management options provided by asp.net?

0 Answers  


If there is submit button in a from tell us the sequence what happens if submit is clicked and in form action is specified as some other page ?

1 Answers   MMTS,


Which protocol is used in a web api?

0 Answers  


Categories