Description
The CssRegistration class registers a cascading style sheet (CSS) file with a page by adding a HTML LINK element to the output HTML for that page. The browser that renders the page then applies any styles defined in the CSS file to that page. You can use the CssRegistration class declaratively or programmatically. To use the class declaratively you add markup to the ASP .NET page markup. Alternatively, you can use the class programmatically by using the methods exposed by the class in C# or Visual Basic .NET.
Usage Scenarios
You will typically use this class to register additional CSS files with a page. Registering the CSS file with the page will ensure that any controls that you have configured to use styles defined in your style sheet use the correct styles.
The following code samples show how to register a CSS file named CustomCss.css with your page.
ASP .NET Markup Sample
<SharePoint:CSSRegistration name=”CustomCss.css” runat=”server” />
C# Code Sample
CssRegistration.Register(“CustomCss.css”);
Visual Basic .NET Code Sample
CssRegistration.Register(“CustomCss.css”)