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

Syntax

'Declaration
Public Property Name As String
    Get
    Set
'Usage
Dim instance As CssRegistration
Dim value As String

value = instance.Name

instance.Name = value
public string Name { get; set; }

Property Value

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

Remarks

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>

See Also

Reference

CssRegistration Class

CssRegistration Members

Microsoft.SharePoint.WebControls Namespace