Sunday, March 27, 2011

CSS in sharepoint

I need to apply a CSS to a Sharepoint site (WSS3.0) based on the theme applied to a site. The CSS would be saved at root site in 'Document Library'. How do I apply the CSS programmatically on the page?

Thanks!

From stackoverflow
  • Put in the page layout or master page. E.g.

    <SharePointWebControls:CssRegistration ID="CssRegistrationMyCSS" name="<% $SPUrl:~sitecollection/Style Library/~language/Core Styles/myCSS.css %>" runat="server"/>
    

    Programatically changing it requires you to modify the control on page load. Not sure how well it would work though.

    Alex Angas : What do you think about Hari's desire to keep it in a document library?
    Nat : I assumed that the document library he was talking about was the Style Library. I guess ya could? Though it would give access to mess with it to a lot more people.

0 comments:

Post a Comment