DetailsView.OnPageIndexChanging(DetailsViewPageEventArgs) 方法

定义

引发 PageIndexChanging 事件。Raises the PageIndexChanging event.

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

参数

e
DetailsViewPageEventArgs

包含事件数据的 DetailsViewPageEventArgsA DetailsViewPageEventArgs that contains the event data.

异常

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

注解

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

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

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

继承者说明

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

适用于

另请参阅