Question

I am making an aspx page and need to link some css pages. From the root of the site collection the css pages are located in Style Library/CSS/files_here.css

My aspx page is located at SitePages/Page.aspx

<SharePoint:CSSRegistration ID="CSSReg5" name="Style Library/CSS/styles.css" After="corev4.css" runat="server"/>

The line I'm using above does not work, what is my flaw in my CSSReg? Before we moved this page to another site collection using a similar structure we had it working correctly.

Was it helpful?

Solution

try

<SharePoint:CSSRegistration ID="CSSReg5" name="<%$SPUrl:~SiteCollection/Style Library/CSS/styles.css%>" After="corev4.css" runat="server"/>

the part <%$SPUrl:~SiteCollection points to the root site collection, maybe your code is not pointing to that location! rather the site or sub site, method above explicitly says root site collection is the css file location!

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top