Export (0) Print
Expand All
Expand Minimize

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.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0
Show:
© 2015 Microsoft