This topic has not yet been rated - Rate this topic

SPWeb.AlternateCssUrl Property

Gets or sets the URL for an alternate cascading style sheet (CSS) to use in the website.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
public string AlternateCssUrl { get; set; }

Property Value

Type: System.String
A string that contains the URL for an alternate CSS file.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
AlternateCssUrl Example

The following is an example of the AlternateCssUrl property in a static method:

public static bool ToggleAlternateCssUrlProperty(SPWeb web, string alternateCssUrl)
{
try
{
if (!string.IsNullOrEmpty(alternateCssUrl))
{
web.AlternateCssUrl = alternateCssUrl;
web.Update();
return true;
}
}
catch (Exception ex)
{

}
return false;
}

Adam Buenz
SharePoint Foundation MVP - http://www.sharepointsecurity.com