FormView.OnItemUpdating(FormViewUpdateEventArgs) 方法

定义

引发 ItemUpdating 事件。Raises the ItemUpdating event.

protected:
 virtual void OnItemUpdating(System::Web::UI::WebControls::FormViewUpdateEventArgs ^ e);
protected virtual void OnItemUpdating (System.Web.UI.WebControls.FormViewUpdateEventArgs e);
abstract member OnItemUpdating : System.Web.UI.WebControls.FormViewUpdateEventArgs -> unit
override this.OnItemUpdating : System.Web.UI.WebControls.FormViewUpdateEventArgs -> unit
Protected Overridable Sub OnItemUpdating (e As FormViewUpdateEventArgs)

参数

e
FormViewUpdateEventArgs

包含事件数据的 FormViewUpdateEventArgsA FormViewUpdateEventArgs that contains the event data.

例外

此方法在 FormView 控件未绑定到数据源控件、用户未取消更新操作以及事件处理程序没有为事件注册时调用。This method is called when the FormView control is not bound to a data source control, the user did not cancel the update operation, and an event handler is not registered for the event.

注解

OnItemUpdating 方法由 FormView 控件调用以引发 ItemUpdating 事件。The OnItemUpdating method is called by the FormView control to raise the ItemUpdating event. 在扩展类时,控件开发人员通常会使用此方法 FormViewIt is generally used by control developers when extending the FormView class.

引发事件时,将通过委托调用事件处理程序。Raising an event invokes the event handler through a delegate. 有关详细信息,请参阅 处理和引发事件For more information, see Handling and Raising Events.

OnItemUpdating 方法还允许派生类对事件进行处理而不必附加委托。The OnItemUpdating method also allows derived classes to handle the event without attaching a delegate. 这是在派生类中处理事件的首选技术。This is the preferred technique for handling the event in a derived class.

继承者说明

在派生类中重写 OnItemUpdating(FormViewUpdateEventArgs) 时,一定要调用基类的 OnItemUpdating(FormViewUpdateEventArgs) 方法,以便已注册的委托对事件进行接收。When overriding OnItemUpdating(FormViewUpdateEventArgs) in a derived class, be sure to call the base class's OnItemUpdating(FormViewUpdateEventArgs) method so that registered delegates receive the event.

适用于

另请参阅