EditorZoneBase.EditorParts Property

Note: This property is new in the .NET Framework version 2.0.

Gets a collection of all the EditorPart controls contained in an EditorZoneBase zone.

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

public:
property EditorPartCollection^ EditorParts {
	EditorPartCollection^ get ();
}
/** @property */
public EditorPartCollection get_EditorParts ()

public function get EditorParts () : EditorPartCollection

Property Value

An EditorPartCollection that contains all the individual EditorPart controls in a zone.

Exception typeCondition

InvalidOperationException

An EditorPart being added to the collection does not have a value assigned to its ID property.

The EditorParts property provides a reference to a collection of all the EditorPart controls in the zone. It references both the EditorPart controls provided with the Web Parts control set, and any custom EditorPart controls that are added to the zone. Because the collection is read-only, developers who want to create custom EditorPart controls for general editing purposes and add them to the collection should override the CreateEditorParts method.

If you design custom EditorPart controls to edit a specific WebPart control, you should override the members of the IWebEditable interface--the CreateEditorParts method and the WebBrowsableObject property--in the WebPart control. The reason to override these members is to enable your WebPart control to create the custom EditorPart controls and add them to the EditorParts collection when your control is being edited, and to provide the editing controls with an object reference to the WebPart control they are editing. If you want to add a custom EditorPart control to edit a server control that does not inherit from the WebPart class, you must implement the IWebEditable interface in the class just as you would for a WebPart control.

NoteNote

Note that any EditorPart that is added to the collection of EditorPart controls in an implementation of the CreateEditorParts method must have a value assigned to its ID property, otherwise an exception will be thrown when the collection is assigned to the EditorParts property.

The following code example demonstrates how to access the EditorParts property programmatically. For the full code required to run the example, see the Example section of the EditorZoneBase class overview topic.

The first part of the code example demonstrates that the EditorParts property contains references to all the EditorPart controls that are referenced declaratively in the Web page.

No code example is currently available or this language may not be supported.

The second part of the code example programmatically accesses the EditorParts property and lists the ID of each control in a Label control.

No code example is currently available or this language may not be supported.

When you load the page in a browser, you can click the Display EditorParts Collection button to list the IDs of all the EditorPart controls referenced in the EditorParts property.

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show: