Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
WebPartAddingEventArgs Class
Collapse the table of content
Expand the table of content

WebPartAddingEventArgs Class

Provides data for the WebPartAdding event.


Namespace:  System.Web.UI.WebControls.WebParts
Assembly:  System.Web (in System.Web.dll)

public class WebPartAddingEventArgs : WebPartCancelEventArgs

The WebPartAddingEventArgs type exposes the following members.

Public methodWebPartAddingEventArgsInitializes a new instance of the WebPartAddingEventArgs class.

Public propertyCancelGets or sets a value indicating whether the event should be canceled. (Inherited from CancelEventArgs.)
Public propertyWebPartGets the Web Parts control involved in the cancelable event. (Inherited from WebPartCancelEventArgs.)
Public propertyZoneGets or sets the Web Parts zone that the Web Parts control is being added to.
Public propertyZoneIndexGets or sets the index position of a WebPart control within its zone.

Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)

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 WebPartAddingEventArgs class contains information that can be used within a WebPartAdding event. It provides access to the Web Parts control that is being added and the zone it is being added to.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
© 2015 Microsoft