相关文章推荐
酒量大的板栗  ·  log4j ...·  1 周前    · 
俊逸的充值卡  ·  Python 批量提取 Word ...·  1 年前    · 
温柔的大脸猫  ·  pytorch1.3.0+cuda10.0+ ...·  1 年前    · 
玩命的豌豆  ·  Monitor and ...·  1 年前    · 

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft Edge More info about Internet Explorer and Microsoft Edge
public:
 virtual property bool EnableEventValidation { bool get(); void set(bool value); };
[System.ComponentModel.Browsable(false)]
public virtual bool EnableEventValidation { get; set; }
[<System.ComponentModel.Browsable(false)>]
member this.EnableEventValidation : bool with get, set
Public Overridable Property EnableEventValidation As Boolean

Property Value

Remarks

When the EnableEventValidation property is set to true , ASP.NET validates that a control event originated from the user interface that was rendered by that control. A control registers its events during rendering and then validates the events during postback or callback handling. For example, if a list control includes options numbered 1, 2, or 3 when the page is rendered, and if a postback request is received specifying option number 4, ASP.NET raises an exception. All event-driven controls in ASP.NET use this feature by default.

If you write client script that changes a control in the client at run time, you might have to use the RegisterForEventValidation method in order to avoid false event validation errors.

Important

This feature reduces the risk of unauthorized or malicious postback requests and callbacks. It is strongly recommended that you do not disable event validation.

You set the EnableEventValidation property by setting the enableEventValidation attribute of the @ Page directive or the enableEventValidation attribute of the pages element in the Web.config file. If you set this property in code, you must set it before the page is initialized.