Export (0) Print
Expand All

Page.EnableEventValidation Property

Gets or sets a value indicating whether the page validates postback and callback events.

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

'Declaration
Public Overridable Property EnableEventValidation As Boolean
'Usage
Dim instance As Page
Dim value As Boolean

value = instance.EnableEventValidation

instance.EnableEventValidation = value
/** @property */
public boolean get_EnableEventValidation ()

/** @property */
public void set_EnableEventValidation (boolean value)

public function get EnableEventValidation () : boolean

public function set EnableEventValidation (value : boolean)

Not applicable.

Property Value

true if the page validates events; otherwise, false.The default is true.

Exception typeCondition

InvalidOperationException

The EnableEventValidation property was set after the page was initialized.

The event validation mechanism reduces the risk of unauthorized postback requests and callbacks. When the EnableEventValidation property is set to true, ASP.NET allows only the events that can be raised by the control during a postback request or callback.

NoteNote:

This event validation mechanism reduces the risk of unauthorized postback requests and callbacks. With this model, a control registers its events during rendering and then validates the events during the post-back or callback handling. All event-driven controls in ASP.NET use this feature by default.

It is strongly recommended that you do not disable event validation. If you do disable event validation, make sure that no postback could be constructed that could have an unintended effect on your application.

In most circumstances, you set the EnableEventValidation property by setting the enabledEventValidation attribute of the @ Page directive or the enableEventValidation attribute of the pages element in the Web.config file. If you set the EnableEventValidation property in code, set it in the Page_Init phase of page processing.

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show:
© 2014 Microsoft