This documentation is archived and is not being maintained.

EditorZoneBase::OnDisplayModeChanged Method

Raises the DisplayModeChanged event and destroys all EditorPart and child controls in the zone in preparation for a Web page to enter or exit the edit display mode.

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

protected:
virtual void OnDisplayModeChanged(
	Object^ sender, 
	WebPartDisplayModeEventArgs^ e
) override

Parameters

sender
Type: System::Object
An Object that raises the DisplayModeChanged event.
e
Type: System.Web.UI.WebControls.WebParts::WebPartDisplayModeEventArgs
A WebPartDisplayModeEventArgs that contains the event data.

The OnDisplayModeChanged method provides an implementation for the base method in the ToolZone class.

The main purpose of the OnDisplayModeChanged method is to prepare a Web page to enter or exit the edit display mode. The method destroys all controls contained in the zone and then calls the base method, which raises the DisplayModeChanged event in the WebPartManager control.

Notes to Inheritors

The OnDisplayModeChanged method can be overridden or called programmatically in a custom editor zone control that inherits from the EditorZoneBase class or the EditorZone class.

The following code example demonstrates how to override the OnDisplayModeChanged method in a derived class. For the full code required to run the example, see the Example section of the EditorZoneBase class overview topic.

The custom editor zone derives from the EditorZone class so that it can be used with a zone template in the declarative markup of the Web page. The custom class overrides the OnDisplayModeChanged method, setting the background color of the zone to a specified color, and then calls the base method, which destroys all child and EditorPart controls in preparation for entering or exiting edit display mode.

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 control to switch to edit mode. You can click the verbs menu (the down arrow) in the title bar of one of the controls, and click Edit to edit the selected control. When the EditorZone control and editing user interface (UI) are visible, you can see that the zone has the background color specified in the code.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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