Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
Page Class
Page Properties
 EnableEventValidation Property

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
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)
Visual Basic (Declaration)
<BrowsableAttribute(False)> _
Public Overridable Property EnableEventValidation As Boolean
Visual Basic (Usage)
Dim instance As Page
Dim value As Boolean

value = instance.EnableEventValidation

instance.EnableEventValidation = value
C#
[BrowsableAttribute(false)]
public virtual bool EnableEventValidation { get; set; }
Visual C++
[BrowsableAttribute(false)]
public:
virtual property bool EnableEventValidation {
    bool get ();
    void set (bool value);
}
JScript
public function get EnableEventValidation () : boolean
public function set EnableEventValidation (value : boolean)
ASP.NET
<asp:Page EnableEventValidation="True|False" />

Property Value

Type: System..::.Boolean
true if the page validates events; otherwise, false.The default is true.
ExceptionCondition
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 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
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker