Export (0) Print
Expand All

CssRegistration class

Represents a cascading style sheet (CSS) file registration. CssLink reads this registration to insert a LINK element into the resulting HTML page and apply the external style sheet(s) defined by the registration.

System.Object
  System.Web.UI.Control
    Microsoft.SharePoint.WebControls.SPControl
      Microsoft.SharePoint.WebControls.CssRegistration

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

[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public sealed class CssRegistration : SPControl

Pages and controls register specific style sheets by using the <SharePoint:CssRegistration name="filename" tag or calling the static CssRegistration.Register("filename") method. The CSS can be registered as a leaf filename or as a URL. For example:

<SharePoint:CSSRegistration name= "<%$SPrl:~SiteCollection/Style Library/~language/Core Stypes/Band.css%>" runat="server"/>

When the page is assembled, all of the style sheets are brought together and rendered by the CssLink control.

NoteNote

The CssRegistration controls may be placed on a master page, page layout, or content page.

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