Language

ViewStateEncryptionMode Enum

Definition

Specifies whether view-state information is encrypted.

public enum class ViewStateEncryptionMode
public enum ViewStateEncryptionMode
type ViewStateEncryptionMode = 
Public Enum ViewStateEncryptionMode
Inheritance
ViewStateEncryptionMode

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


    
Customer identifier:
Retrieve customer info:
<%@ Page Language="VB" AutoEventWireup="true" %>







    Customer Information


    
Customer identifier:
Retrieve customer info:

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.

Applies to