DesignModeConsoleContainer Class
Represents a container that is used to display and hide the design mode console, based on the context in which the container is used.
System.Object
System.Web.UI.Control
System.Web.UI.WebControls.WebControl
Microsoft.SharePoint.WebControls.DesignModeConsoleContainer
System.Web.UI.Control
System.Web.UI.WebControls.WebControl
Microsoft.SharePoint.WebControls.DesignModeConsoleContainer
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)] [AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] public sealed class DesignModeConsoleContainer : WebControl, INamingContainer
DesignModeConsoleContainer
Description
The Microsoft.SharePoint.WebControls.DesignModeConsoleContainer class inherits from the System.Web.UI.WebControl class to support traditional ASP.NET web controls as well as the System.Web.UI.INamingContainer interface used as a marker interface in order to produce unique naming that targets the complete page scope. In order to function, the DesignModeConsoleContainer class relies on the INamingContainer interface to handle any of its child controls, since it acts as a container control.
DesignModeConsoleContainer is primarily evident when working with the SharePoint layout pages, being shipped with WSS platform as opposed to the EditModePanel control which is restricted to MOSS platform. The purpose of DesignModeConsoleContainer is meant as a toggling mechanism between Edit and Design mode, however is targeted to toggle display mechanisms, not instantiating any editing controls within its container. In order to toggle visibility of the container, it should be noted that SPWebPartManager objects are used to interrogate the state of a Page.
Usage Scenario
DesignModeConsoleContainer use is primarily found within the shipped WSS layout and WebPart pages. It is possible to use DesignModeConsoleContainer as a customary WebControl, however it is more common that people place the control tag reference within custom SharePoint layout pages.
In the below example, MyClass is inheriting from the System.Web.UI.WebControls.WebParts.WebPart class and its CreateChildControls method is being overridden. Following, a new DesignModeConsoleContainer object is being created. Following, a new Literal control (LiteralControl to be exact since it doesn’t require processing on the server) is being created with some arbitrary text, which is added to the DesignModeConsoleContainer control collection. Following, the DesignModeConsoleContainer control is added to the current instance control collection.
C# Code Example
public class MyClass : WebPart
{
protected override void CreateChildControls()
{
DesignModeConsoleContainer container = new DesignModeConsoleContainer();
container.Controls.Add(new LiteralControl("Adam Buenz Is A MVP"));
Controls.Add(container);
base.CreateChildControls();
}
}
VB.NET Code Example
Public Class [MyClass]
Inherits WebPart
Protected Overloads Overrides Sub CreateChildControls()
Dim container As New DesignModeConsoleContainer()
container.Controls.Add(New LiteralControl("Adam Buenz Is A MVP"))
Controls.Add(container)
MyBase.CreateChildControls()
End Sub
End Class
The Microsoft.SharePoint.WebControls.DesignModeConsoleContainer class inherits from the System.Web.UI.WebControl class to support traditional ASP.NET web controls as well as the System.Web.UI.INamingContainer interface used as a marker interface in order to produce unique naming that targets the complete page scope. In order to function, the DesignModeConsoleContainer class relies on the INamingContainer interface to handle any of its child controls, since it acts as a container control.
DesignModeConsoleContainer is primarily evident when working with the SharePoint layout pages, being shipped with WSS platform as opposed to the EditModePanel control which is restricted to MOSS platform. The purpose of DesignModeConsoleContainer is meant as a toggling mechanism between Edit and Design mode, however is targeted to toggle display mechanisms, not instantiating any editing controls within its container. In order to toggle visibility of the container, it should be noted that SPWebPartManager objects are used to interrogate the state of a Page.
Usage Scenario
DesignModeConsoleContainer use is primarily found within the shipped WSS layout and WebPart pages. It is possible to use DesignModeConsoleContainer as a customary WebControl, however it is more common that people place the control tag reference within custom SharePoint layout pages.
In the below example, MyClass is inheriting from the System.Web.UI.WebControls.WebParts.WebPart class and its CreateChildControls method is being overridden. Following, a new DesignModeConsoleContainer object is being created. Following, a new Literal control (LiteralControl to be exact since it doesn’t require processing on the server) is being created with some arbitrary text, which is added to the DesignModeConsoleContainer control collection. Following, the DesignModeConsoleContainer control is added to the current instance control collection.
C# Code Example
public class MyClass : WebPart
{
protected override void CreateChildControls()
{
DesignModeConsoleContainer container = new DesignModeConsoleContainer();
container.Controls.Add(new LiteralControl("Adam Buenz Is A MVP"));
Controls.Add(container);
base.CreateChildControls();
}
}
VB.NET Code Example
Public Class [MyClass]
Inherits WebPart
Protected Overloads Overrides Sub CreateChildControls()
Dim container As New DesignModeConsoleContainer()
container.Controls.Add(New LiteralControl("Adam Buenz Is A MVP"))
Controls.Add(container)
MyBase.CreateChildControls()
End Sub
End Class
- 5/18/2010
- Adam Buenz - MVP
- 5/24/2010
- Adam Buenz - MVP