Microsoft.SharePoint.WebCon ...


DesignModeConsoleContainer Class (Microsoft.SharePoint.WebControls)

Namespace: Microsoft.SharePoint.WebControls
Assembly: Microsoft.SharePoint (in microsoft.sharepoint.dll)
Syntax

Visual Basic (Declaration)
<ParseChildrenAttribute(False)> _
<NonVisualControlAttribute(True)> _
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel:=True)> _
<AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level:=AspNetHostingPermissionLevel.Minimal)> _
<SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel:=True)> _
<AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level:=AspNetHostingPermissionLevel.Minimal)> _
Public NotInheritable Class DesignModeConsoleContainer
    Inherits WebControl
    Implements INamingContainer
Visual Basic (Usage)
Dim instance As DesignModeConsoleContainer
C#
[ParseChildrenAttribute(false)] 
[NonVisualControlAttribute(true)] 
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel=true)] 
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] 
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel=true)] 
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)] 
public sealed class DesignModeConsoleContainer : WebControl, INamingContainer
Inheritance Hierarchy

System.Object
   System.Web.UI.Control
     System.Web.UI.WebControls.WebControl
      Microsoft.SharePoint.WebControls.DesignModeConsoleContainer
Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also

Tags :


Community Content

Thomas Lee
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



Page view tracker