CssRegistration.Name Property
Gets or sets the name of the cascading style sheet (CSS) file to register.
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
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>