Is it possible to use the cssregistration control but not let it reference to a language folder?

I want to use the cssregistration control to be able to use revisions for my stylesheets. This way, when I change something in it, I know for sure users get the updated stylesheet. However I do not like that it always looks in the lcid folder when I use this mechanism. Because if a user switches his language, the stylesheet can no longer be found. How would I solve this? As far as I know you cannot turn of the lcid part of the path without loosing the ?rev= parameter and Visual Studio does not allow me to deploy the same file to multiple folders. (Which can be done, but causes other problem in Visual Studio and also does not take any newly installed languages into account)

Hope someone knows the answer to this one ;)

1 Answer 1


A simple trick is use the .. to get higher in the folders:

<SharePoint:CssRegistration name="../../Your.Name.Space/css/style.css" runat="server" After="corev4.css"/>

This will produce a html like:

<link rel="stylesheet" type="text/css" href="/_layouts/1033/styles/../../Your.Name.Space/css/style.css?rev=XXXXXXXX"/>

The browser will interpret the ../.. part. This makes it in the html output a little bit ugly, but it works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.