Welcome to Questionaries, where you can ask questions and receive answers from other members of the community.

Let us know at info@questionaries.org

What does the "EnableViewState" property do?

3 like 0 dislike
What does the "EnableViewState" property do? Why would I want it on or off?
asked 1 year ago by marck_don (191,010 points)

1 Answer

1 like 0 dislike
 
Best answer
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 (as in the datagrid example in tip #4), 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.
answered 1 year ago by daneim (127,080 points)

Related questions

2 like 0 dislike
1 answer
asked 1 year ago by daneim (127,080 points)
10 like 1 dislike
1 answer
2 like 0 dislike
1 answer