Is it some how possible to include your custom css files in this control?

<SharePoint:CssLink runat="server" Version="4"/>

I usually wind up inserting the same 3 custom css files in the masterpage whenever I start a new SharePoint project. So I thought since the above control inserts all standard SharePoint stylesheets, I could maybe incluce my own css files in it. But is it possible?


Yes, use the CssRegistration control to add your own CSS files. They are inserted into the page using the CssLink conrol in the masterpage.

Hint: Use the After property to load your css file after a specific file, such as 'corev4.css'. This will let you define the load order of your CSS.

You can insert your three instances of CssRegistration into a new UserControl in your project, and load this via a Delegate Control in a Feature, to insert your UserControl into the AdditionalPageHead delegate control.

| improve this answer | |
  • Thanks for the hint. I've already thought of doing this, but thought I might try out the OOTB if it was possible. But if this is the only way, I guess it's good enough as it does what I need it to. – user2536 Dec 8 '11 at 9:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy