GenericWebPart.CreateEditorParts Method

Definition

Returns a collection of custom EditorPart controls that can be used to edit the child control of a GenericWebPart control when it is in edit mode.

C#
public override System.Web.UI.WebControls.WebParts.EditorPartCollection CreateEditorParts();

Returns

An EditorPartCollection that contains custom EditorPart controls associated with a server control.

Remarks

The CreateEditorParts method is called when a control enters edit display mode. This method overrides the base method inherited from the WebPart class because, in the case of a GenericWebPart control, it is the child control that is being edited, not the GenericWebPart control itself. The CreateEditorParts method casts the child control to the IWebEditable interface, which enables the control to be edited.

This overridden method is what enables server controls that do not derive from the WebPart class--including ASP.NET server controls, and custom server controls--to be edited as normal WebPart controls.

Applies to

Продукт Версії
.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