WebPartAddingEventHandler Delegate

Definition

Represents the method that handles the WebPartAdding event of a WebPartManager object.

C#
public delegate void WebPartAddingEventHandler(object sender, WebPartAddingEventArgs e);

Parameters

sender
Object

The source of the event.

e
WebPartAddingEventArgs

A WebPartAddingEventArgs that contains the event data.

Remarks

The WebPartAdding event is raised by the OnWebPartAdding method just before adding a control to a Web Parts zone. This event provides an opportunity to cancel the process before it is complete. The WebPartAdded event is called after a control has been added to a Web Parts zone.

The method specified in the WebPartAddingEventHandler delegate is called when a WebPartAdding event is raised.

Page developers can provide custom handlers for the event by adding the OnWebPartAdding attribute to the <asp:webpartmanager> element in a page, and assigning a custom method name to the attribute. A custom handler can also be assigned programmatically. For more information about how to subscribe to an event, see How to: Raise and Consume Events.

Extension Methods

GetMethodInfo(Delegate)

Gets an object that represents the method represented by the specified delegate.

Applies to

Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also