EditorZone Class

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

Serves as the primary control in the Web Parts control set for hosting EditorPart controls on a Web page.

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

public ref class EditorZone : public EditorZoneBase
public class EditorZone extends EditorZoneBase
public class EditorZone extends EditorZoneBase

Within the Web Parts control set, a zone is a composite control that covers a defined region on a Web page and contains server controls. The primary functions of a zone are to lay out the controls it contains, and to provide a common user interface (UI) for those controls. For general information about zones and how they are used in Web Parts applications, see the reference documentation for the base WebZone class, and Web Parts Control Set Overview.

The EditorZone control is one of the fundamental controls in the Web Parts control set. A key feature of Web Parts is the ability of end users to modify (or personalize) Web pages according to their preferences, and save their personalized settings for future browser sessions. One aspect of modifying Web Parts pages includes editing; users can edit the appearance, layout, behavior, and other properties of the visible WebPart controls. Several controls in the Web Parts control set provide the editing features, including the EditorZone control.

An EditorZone control becomes visible when a Web Parts page enters edit mode, and it makes available various EditorPart controls that can be used to personalize WebPart controls. The EditorZone control is very similar to its parent, the EditorZoneBase class, with one key difference: The EditorZone control provides a zone template, referenced in its ZoneTemplate property. The zone template adds the ability to declare content in the page persistence format. Page developers can place an EditorZone control in the declarative markup of a Web page, add a child <zonetemplate> element, and within the <zonetemplate> element, add declarative references to EditorPart controls.

The EditorZone control also has a method, CreateEditorParts, which overrides a base method in the EditorZoneBase class. This method is necessary so that an EditorZone control can create the zone template to contain any EditorPart controls that are added to the zone declaratively.


The buttons in the EditorZone UI require client-side scripting in order to work correctly. If scripting is disabled in the browser, the user will not be able to perform actions through the EditorZone UI.


The markup rendered by default for this control might not conform to accessibility standards such as the Web Content Accessibility Guidelines 1.0 (WCAG) priority 1 guidelines. For details about accessibility support for this control, see ASP.NET Controls and Accessibility.

Notes to Inheritors If you want to create a custom EditorZone zone to gain greater control over the rendering of the editing UI, you can inherit directly from the EditorZoneBase class, as long as you do not need to provide zone template support for page developers to add EditorPart controls to your zone declaratively. In such a case, you would add all EditorPart controls to a zone programmatically. If you want to provide zone template support, you should inherit from the EditorZone class.

The following code example demonstrates several declarative and programmatic uses of the EditorZone class. The example creates a custom editor zone that inherits from the EditorZone class, and uses it in a Web Parts page.

The code example has three parts:

  • A user control that enables you to change display modes on the Web page.

  • A Web page that references the custom EditorZone control.

  • An explanation of how the example works.

The first part of this code example is the user control that enables users to change display modes on a Web page. For more details about display modes and a description of the source code in this control, see Walkthrough: Changing Display Modes on a Web Parts Page.

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

The second part of the code example is a Web page. Near the top of the page is a Register directive for the user control. The user control tag is declared in the page with a uc1: prefix for the element. Notice that below the <asp:WebPartZone> element is an <asp:EditorZone> element that contains several EditorPart controls, with some tags and properties set to determine its appearance and behavior. There are also a number of methods that access various members of the EditorZone control programmatically.

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

When you load the page in a browser, you can select Edit Mode in the drop-down list to switch to edit mode. To display the editing UI, you can click the verbs menu (the downward arrow) in the title bar of one of the two controls, and click Edit to edit the control. With the editing UI visible, you can see the effects of the declarative and programmatic uses of the EditorZone class members.

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

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