sharepoint:cssLink returns a broken link [closed]
-
09-12-2019 - |
Question
I'm developing the master page for my company's intranet. I've read that this html will link all default and custom css files.
<sharepoint:csslink runat="server" version="4" />
I get back what is expected but the custom link ends up returning a 404 error. This is the resulting html from firebug.
<link href="/_layout/pipeline/masterStyle.css" type="text/css" rel="stylesheet">
404 NOT FOUND
</link>
<link href="/_layouts/1033/styles/Themable/corev4.css?rev=iIikGkMuXBs8CWzKDAyjsQ%3D%3D" type="text/css" rel="stylesheet">
The url is wrong but I don't know what to change to get _layout -> _layouts I want to use:
<sharepoint:cssregistration id="master_style" name="/_layouts/pipeline/masterStyle.css" after="corev4.css" runat="server" />
When I do the code works but I still have a duplicate link with a 404 error.
<link href="/_layouts/1033/styles/Themable/layouts.css?rev=aTcoNUf8p1YiDzYCg3%2FLIw%3D%3D" type="text/css" rel="stylesheet">
<link href="/_layout/pipeline/masterStyle.css" type="text/css" rel="stylesheet">
404 NOT FOUND
</link>
<link href="/_layouts/1033/styles/Themable/corev4.css?rev=iIikGkMuXBs8CWzKDAyjsQ%3D%3D" type="text/css" rel="stylesheet">
<link id="master_style" href="/_layouts/pipeline/masterStyle.css" type="text/css" rel="stylesheet">
I've tried to use the mighty google but most articles only show how to get to this point. I have not been able to find another person that has encountered this. Anyone know how I prevent cssLink from returning custom css links? or where the broken link comes from?
Solution
Turns out that I'm the source of my own problems. I traced the error message and found that an application page I made was calling <sharepoint:cssregistration id="master_style" name="/_layout/pipeline/masterStyle.css" after="corev4.css" runat="server" />
. Typo on my part, that was easily forgotten. Also, I found that the css file I put in the Layouts folder was not being deployed. I moved it to /_layouts/STYLES/, changed the cssregistration path and now it works perfectly.