DetailsView.OnItemInserted(DetailsViewInsertedEventArgs) Method


引发 ItemInserted 事件。Raises the ItemInserted event.

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



包含事件数据的 DetailsViewInsertedEventArgsA DetailsViewInsertedEventArgs that contains the event data.


DetailsView 控件调用 OnItemInserted 方法来引发 ItemInserted 事件。The OnItemInserted method is called by the DetailsView control to raise the ItemInserted event. 它通常由控件开发人员在扩展 DetailsView 类时使用。It is generally used by control developers when extending the DetailsView class.

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

Notes to Inheritors

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

Applies to

See also