Export (0) Print
Expand All

PagesSection::EnableEventValidation Property

Gets or sets a value that specifies whether event validation is enabled.

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

[ConfigurationPropertyAttribute(L"enableEventValidation", DefaultValue = true)]
public:
property bool EnableEventValidation {
	bool get ();
	void set (bool value);
}

Property Value

Type: System::Boolean
true if event validation is enabled; otherwise, false.

The EnableEventValidation attribute indicates whether event validation should be performed. The default value is true. A Web application can optionally disable event validation to revert to .NET Framework version 1.0 behavior.

The base control checks this attribute to determine whether it should validate events. A derived control does not inherit this base control attribute, and so it is exempt from event validation by default. You still instruct ASP.NET to perform event validation on the derived control by adding the EnableEventValidation attribute to the derived control itself and setting it to true.

NoteNote

Event validation reduces the risk of unauthorized postback requests and callbacks. It instructs ASP.NET to validate only those events that can be raised in the control during a postback request or callback. 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.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Show:
© 2014 Microsoft