Documentation for this section has not yet been entered.
The Page.ViewStateEncryptionMode property cannot be set in code. It can only be set in the @ Page directive or in the <pages> element of the configuration file. Values set in the @ Page directive override any values set in the configuration file.
The syntax for setting this property in the @ Page directive is as follows:
Example
<%@ Page Language="VB" ViewStateEncryptionMode="Always" %>
Example
<%@ Page Language="C#" ViewStateEncryptionMode="Always" %>
The syntax for setting this property in the configuration file is as follows:
Example
<system.web> <pages viewStateEncryptionMode="Always" /> </system.web>
Example
<system.web> <pages viewStateEncryptionMode="Always" /> </system.web>
Custom control developers may wish to check the value of this property in code before saving potentially sensitive data to view state in their control.