Serves as the primary control in the Web Parts control set for hosting EditorPart controls on a Web page.
Assembly: System.Web (in System.Web.dll)
[AspNetHostingPermissionAttribute(SecurityAction::InheritanceDemand, Level = AspNetHostingPermissionLevel::Minimal)] [AspNetHostingPermissionAttribute(SecurityAction::LinkDemand, Level = AspNetHostingPermissionLevel::Minimal)] public ref class EditorZone : public 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 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 control.
An 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 control is very similar to its parent, the EditorZoneBase class, with one key difference: The 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 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 control also has a method, CreateEditorParts, which overrides a base method in the EditorZoneBase class. This method is necessary so that an control can create the zone template to contain any EditorPart controls that are added to the zone declaratively.
The buttons in the 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 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.
If you want to create a custom 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 class.
The following code example demonstrates several declarative and programmatic uses of the class. The example creates a custom editor zone that inherits from the 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 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.
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 control programmatically.
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 class members.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.