PagesSection.EnableEventValidation Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a value that specifies whether event validation is enabled.
public:
property bool EnableEventValidation { bool get(); void set(bool value); };
[System.Configuration.ConfigurationProperty("enableEventValidation", DefaultValue=true)]
public bool EnableEventValidation { get; set; }
[<System.Configuration.ConfigurationProperty("enableEventValidation", DefaultValue=true)>]
member this.EnableEventValidation : bool with get, set
Public Property EnableEventValidation As Boolean
true
if event validation is enabled; otherwise, false
.
- Attributes
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
.
Note
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.
Product | Versions |
---|---|
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: