System.Web.UI.WebControls.WebParts.IWebEditable.CreateEditorParts Method

Returns a collection of custom System.Web.UI.WebControls.WebParts.EditorPart controls associated with a server control that implements the System.Web.UI.WebControls.WebParts.IWebEditable interface.

Syntax

public EditorPartCollection CreateEditorParts ()

Returns

An System.Web.UI.WebControls.WebParts.EditorPartCollection that contains the collection of custom System.Web.UI.WebControls.WebParts.EditorPart controls associated with a server control.

Remarks

The IWebEditable.CreateEditorParts method enables you to create a collection of all the custom System.Web.UI.WebControls.WebParts.EditorPart controls associated with your custom control, System.Web.UI.WebControls.WebParts.WebPart control, or user control, and return them as an System.Web.UI.WebControls.WebParts.EditorPartCollection object. The System.Web.UI.WebControls.WebParts.WebPartManager control takes the collection and creates instances of all the System.Web.UI.WebControls.WebParts.EditorPart controls whenever the server control enters edit mode.

Typically you implement this method in a custom System.Web.UI.WebControls.WebParts.WebPart control by overriding its WebPart.CreateEditorParts method. In the method, you create instances of the custom System.Web.UI.WebControls.WebParts.EditorPart controls you want to associate with your controls, add them to an System.Web.UI.WebControls.WebParts.EditorPartCollection object, and then return that object. The collection of System.Web.UI.WebControls.WebParts.EditorPart controls is then assigned to the EditorZoneBase.EditorParts property of the System.Web.UI.WebControls.WebParts.EditorZoneBase zone.

Note:

Any System.Web.UI.WebControls.WebParts.EditorPart that is added to the collection of System.Web.UI.WebControls.WebParts.EditorPart controls in an implementation of the IWebEditable.CreateEditorParts method must have a value assigned to its ID property, otherwise an exception will be thrown when the collection is assigned to the EditorZoneBase.EditorParts property.

Requirements

Namespace: System.Web.UI.WebControls.WebParts
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0