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 are the different ASP.NET Application Folders?

1 Answers   Wipro,


How many languages are supported by .NET at present time?

0 Answers  


What is strong-typing versus weak-typing? Which is preferred? Why?

2 Answers  


Can you use Web API with ASP.NET Web Form?

0 Answers  


Can you explain one critical mapping?

0 Answers  






My website has around 100 aspx. Out of this, a certain 20 aspx files should be made available to the users only if they are logged in. How can I achieve this with the web.config file?

1 Answers   Techno Solutions,


Please briefly explain the usage of global.asax?

0 Answers  


What are server side controls?

0 Answers  


In this case if exception occure in Database which catch block will be exexcuted?

1 Answers   Microsoft,


Where can i get Latest Microsoft .Net Certification Dumps & what Types of .Net Certifications are there?

2 Answers   Protech,


Difference between viewstate, cache, session

2 Answers   Mind Tree,


What is a url string?

0 Answers  


Categories