0 out of 5 rated this helpful - Rate this topic

CssRegistration.Name Property

Gets or sets the name of the cascading style sheet (CSS) file to register.

Namespace:  Microsoft.SharePoint.WebControls
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
public string Name { get; set; }

Property Value

Type: System.String
A string that contains the name.

The Name property takes a CSS file leaf (“trader.css”) or an absolute path (“http://northwind.com/trader.css”).

The CssRegistration control can use a token inside the ASP tags such as $SPUrl:~SiteCollection. understands this token and fills in the appropriate Site Collection URL at runtime. This allows the markup to be portable to non-root site collections (such as /sites/sc1). For example:

<head runat="server"> 
<asp:ContentPlaceHolder runat="server" id="head"> 
<title> 
<asp:ContentPlaceHolder id="PlaceHolderPageTitle" runat="server" /> 
</title> 
</asp:ContentPlaceHolder> 
<Sharepoint:CssLink runat="server"/> 
<!-- Product Group Custom Styles --> 
<%--SharePoint:CssRegistration name="<% $SPUrl:~SiteCollection/Style Library/PG/PG.css%>" runat="server"/--%> 
<link type="text/css" rel="stylesheet" href="/_layouts/1033/styles/PG/PG.css" /> 
<!-- End Product Group Custom Styles --> 
<asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server" />
</head>
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ