views:

119

answers:

1

Was the new ViewStateMode property introduced to avoid breaking the existing EnableViewState?

Does setting EnableViewState = false at the page level causee the ViewStateMode setting to be ignored?

PS: What is CW in stackoverflow?

+1  A: 

It is backward compaitable as the default value is Inherit.

If the parent control has set EnableViewState to false then ViewStateMode allows child control to enable it giving much more fine grained control over your viewstate.

see http://weblogs.asp.net/sreejukg/archive/2010/04/06/viewstatemode-in-asp-net-4-0.aspx

"The default value of the ViewStateMode property for a page is Enabled. The default value of the ViewStateMode property for a Web server control in a page is Inherit. As a result, if you do not set this property at either the page or the control level, the value of the EnableViewState property determines view-state behavior."

See http://msdn.microsoft.com/en-us/library/system.web.ui.control.viewstatemode.aspx

Damien McGivern