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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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