This documentation is archived and is not being maintained.

WebPartManager::OnDisplayModeChanging Method

Raises the DisplayModeChanging event to indicate that the WebPartManager control is in the process of switching from one display mode to another on a Web page.

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

protected:
virtual void OnDisplayModeChanging(
	WebPartDisplayModeCancelEventArgs^ e
)

Parameters

e
Type: System.Web.UI.WebControls.WebParts::WebPartDisplayModeCancelEventArgs

An EventArgs that contains event data associated with a changing display mode.

The OnDisplayModeChanging method in its base form simply raises the DisplayModeChanging event.

Notes to Inheritors:

You can override the OnDisplayModeChanging method. For example, as a display mode is changing, you might want to check what the new display mode will be (by using the NewDisplayMode property) and change something in the user interface (UI) based on what the new display mode will be. If you had a custom display mode, you might want to make certain controls visible if the custom mode is going to be the new display mode.

When you override this method, you should normally call the base method as the first step of the overridden method, so that the event is raised to indicate a display mode is starting to change. Then, your custom code can make changes in the user interface (UI) before the new display mode is actually displayed.

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.

.NET Framework

Supported in: 3.5, 3.0, 2.0
Show: