EditorZoneBase.OnDisplayModeChanged Method

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

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
protected void OnDisplayModeChanged (
	Object sender, 
	WebPartDisplayModeEventArgs e
)
protected override function OnDisplayModeChanged (
	sender : Object, 
	e : WebPartDisplayModeEventArgs
)

Parameters

sender

An Object that raises the DisplayModeChanged event.

e

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.

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: