DetailsView.OnModeChanging(DetailsViewModeEventArgs) 方法

定义

引发 ModeChanging 事件。Raises the ModeChanging event.

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

参数

e
DetailsViewModeEventArgs

包含事件数据的 DetailsViewModeEventArgsA DetailsViewModeEventArgs that contains the event data.

异常

没有 ModeChanging 事件的处理程序。There is no handler for the ModeChanging event.

注解

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

OnModeChanging 方法还允许派生类对事件进行处理而不必附加委托。The OnModeChanging 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.

继承者说明

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

适用于

另请参阅