WebPartManager::DesignDisplayMode Field
Represents the display mode used for changing the layout of Web pages that contain Web Parts controls. This field is read-only.
Assembly: System.Web (in System.Web.dll)
The DesignDisplayMode field references a custom WebPartDisplayMode object that is created and contained by the WebPartManager control. Because this is a static object, you can refer to it directly through the WebPartManager class without needing an instance of the control.
When a page that contains Web Parts controls first loads, it is in BrowseDisplayMode (browse mode) by default. When users want to change the layout of the page by moving controls to different zones or within the current zones, they must first switch the page to DesignDisplayMode (design mode). In design mode, the user interface (UI) for the various zones appears, and users can then drag controls to change the layout.
The following code example demonstrates how to work with the DesignDisplayMode field programmatically. The code populates a drop-down list with the supported display modes for the page, which in this case are browse and design. Notice that, in the Page_PreRender method, the code checks whether the current DisplayMode property is set to DesignDisplayMode. If so, Label1 will be visible, and if not, Label1 will be hidden.
After you load the page in a browser, you are in browse mode by default. Notice that the label on the page is hidden. Use the drop-down list control to switch the page to design mode. Notice that, because of the code in the Page_PreRender method, the label is now visible.
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.