Click to Rate and Give Feedback

  Switch on low bandwidth view
Community Content
In this section
Statistics Annotations (0)
CssLink Class (Microsoft.SharePoint.WebControls)
Inserts a LINK element into the resulting HTML page and applies an external style sheet(s) defined by CssRegistration.

Namespace: Microsoft.SharePoint.WebControls
Assembly: Microsoft.SharePoint (in microsoft.sharepoint.dll)
Visual Basic (Declaration)
<ToolboxDataAttribute("<{0}:CssLink runat=" & ChrW(34) & "server" & ChrW(34) & " />")> _
<SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel:=True)> _
<AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level:=AspNetHostingPermissionLevel.Minimal)> _
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel:=True)> _
<AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level:=AspNetHostingPermissionLevel.Minimal)> _
Public Class CssLink
    Inherits SPControl
Visual Basic (Usage)
Dim instance As CssLink
C#
[ToolboxDataAttribute("<{0}:CssLink runat=\"server\" />")] 
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel=true)] 
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)] 
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel=true)] 
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] 
public class CssLink : SPControl

The CssLink server control resides on the master page while CssRegistration controls may be placed on a master page, page layout, or content page.

When the page is assembled, all of the style sheets are rendered by the CssLink control. The CssLink control renders registered style sheet links in alphabetical order, then Core.css is rendered, finally themes are registered. If the styles that you define in your .css file are also in Core.css or the theme they will be overwritten (typical .css behavior).

CautionCaution:

Changes made to Core.css may be lost when Windows SharePoint Services is updated, such as through installation of service packs or patches. An alternate .css file can be specified in the Onet.xml file of a site definition by using the AlternateCSS attribute of the Project element.

Refer to Core.css in Cascading Style Sheets Class Definitions for Windows SharePoint Services for more information.

<Sharepoint:CssLink runat="server"/>

System.Object
   System.Web.UI.Control
     Microsoft.SharePoint.WebControls.SPControl
      Microsoft.SharePoint.WebControls.CssLink
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker