System.Web.UI.Page.ViewStateEncryptionMode Property

Gets or sets the encryption mode of the view state.

Syntax

public ViewStateEncryptionMode ViewStateEncryptionMode { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

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.

Requirements

Namespace: System.Web.UI
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0