3

I have a customed CSS file. I add it in my farm solution and then deploy. And it works well. But some persons do not have same view as me. I don't know why. We are in the same company, have the same IE version, even have the same brand of computer.

How can I correct this problem ?

  • how to you reference it? directly from layouts? – Tiago Duarte Jul 7 '15 at 14:29
  • 1
    Yes, in the layouts – AnnaCICI Jul 7 '15 at 14:31
  • in layouts and displaying differently? interesting. it is possible that one is using compatibility view and the other isn't? could also be some sort of caching. – Tiago Duarte Jul 7 '15 at 14:43
  • Not possible be caching. He has deleted all caching....Maybe the computer setting....... – AnnaCICI Jul 7 '15 at 15:03
  • is the page layout published and approved? – Eric Alexander Jul 7 '15 at 17:30
7

If you have deployed the CSS file to the Style Library or an Assets library, make sure it is checked in as a major version and approved.

It could be possible that your page layout is not published and approved as well.

This is the typical symptom when an asset is not approved, it works fine for admins but not general users.

  • 1
    Hi, I add this CSS file to my farm solution, and deploy this solution in Visual Studio. It is saved in the SharePoint server. I did not upload the CSS file to Style Library or an Assets library – AnnaCICI Jul 8 '15 at 8:46
0

As the others have mentioned this issue depends on where the Css is stored and how it is referenced.

You mention in the comments to @EricAlxander that the Css file is stored on the server itself. I'm presuming you are deploying it in the Layouts folder. This is fine.

The issue probably lies in how you reference your custom Css file.
I'm guessing you are not referencing it in the Alternate CSS URL field in the Master page system page.

If you have a custom Master page and the Css file is referenced directly in the Master page itself - please check that the Master page is checked in and published.

If you have custom Page layouts and the Css file is referenced in those - please check that the Page layouts are checked in and published.


Update
Try adding ?rev=something at the end of the css url, so it looks something like /_layouts/MyCompany/Css/Company.css?rev=something. This should make the css url appear as a new url to the browser, in case the browser has cached the css file, and therefor the old css url should be replaced by the new one.

I usually add ?rev={todays date} (e.g. /_layouts/MyCompany/Css/Company.css?rev=20150708)

  • Hi, CSS file is referenced directly in the custom master page. The master page is checked in and published. Most of users can see the new CSS view, but 4 or 5 persons cannot see it. We use the same computer, same system, same IE version. I cannot find a solution...... – AnnaCICI Jul 8 '15 at 9:27
  • @MKQian Please see my updated answer and try it. – user2536 Jul 8 '15 at 9:35

Your Answer

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

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