Export (0) Print
Expand All

LayoutDivContainer class

Provides the class for HTML server controls that map to HTML DIV elements and can be styled individually for any page.

System.Object
  System.Web.UI.Control
    System.Web.UI.HtmlControls.HtmlControl
      System.Web.UI.HtmlControls.HtmlContainerControl
        Microsoft.SharePoint.Publishing.WebControls.LayoutDivContainer

Namespace:  Microsoft.SharePoint.Publishing.WebControls
Assembly:  Microsoft.SharePoint.Publishing (in Microsoft.SharePoint.Publishing.dll)

[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel = true)]
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class LayoutDivContainer : HtmlContainerControl

When added to a page layout, the CSS classes for this web control can be overridden by using an alternate CSS on a per-page level.

The LayoutDivContainer class inherits HtmlContainerControl.

The RenderAttributes() method is overridden so that for each defined CSS class a new CSS class is added with an extended name, "[original name]-[page title]".

For example, if the following control is added to the page layout:

<LayoutDivContainer runat="server" class="fullPageLayout" />

it is rendered on the "Home" page as follows:

<div class="fullPageLayout fullPageLayout-Home" />

You then can override the fullPageLayout-Home in the DIV class by using an alternate CSS file.

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

Community Additions

Show:
© 2014 Microsoft