ViewStateEncryptionMode Enum
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Specifies whether view-state information is encrypted.
public enum class ViewStateEncryptionMode
public enum ViewStateEncryptionMode
type ViewStateEncryptionMode =
Public Enum ViewStateEncryptionMode
- Inheritance
Fields
| Name | Value | Description |
|---|---|---|
| Auto | 0 | The view-state information is encrypted if a control requests encryption by calling the RegisterRequiresViewStateEncryption() method. This is the default. |
| Always | 1 | The view-state information is always encrypted. |
| Never | 2 | The view-state information is never encrypted, even if a control requests it. |
Examples
The following code example demonstrates setting the view-state encryption mode for a Page object and requesting encryption of the view-state information through the RegisterRequiresViewStateEncryption method. In this example, the view-state information will be encrypted when customer information is retrieved from a database.
<%@ Page Language="C#" AutoEventWireup="true" %>
Customer Information
<%@ Page Language="VB" AutoEventWireup="true" %>
Customer Information
Remarks
The ViewStateEncryptionMode enumeration provides values for specifying whether the view-state information in a Page object is encrypted. The ViewStateEncryptionMode value can be set only in the @ Page directive or in the pages section of the configuration file.