Export (0) Print
Expand All

Page.ViewStateEncryptionMode Property

Gets or sets the encryption mode of the view state.

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

public function get ViewStateEncryptionMode () : ViewStateEncryptionMode 
public function set ViewStateEncryptionMode (value : ViewStateEncryptionMode)
<asp:Page ViewStateEncryptionMode="ViewStateEncryptionMode" />

Property Value

Type: System.Web.UI.ViewStateEncryptionMode
One of the ViewStateEncryptionMode values. The default value is Auto.

ExceptionCondition
ArgumentOutOfRangeException

The value set is not a member of the ViewStateEncryptionMode enumeration.

InvalidOperationException

The ViewStateEncryptionMode property can be set only in or before the page PreRenderphase in the page life cycle.

The 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:

No code example is currently available or this language may not be supported.

The syntax for setting this property in the configuration file is as follows:

No code example is currently available or this language may not be supported.

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.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0

Community Additions

ADD
Show:
© 2014 Microsoft