My site located in folder /website
In browser it opens by url http://localhost:52912/website/
My Default page amd master page both located in root catalog
in Default.aspx i include my master page like:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" MasterPageFile="WTF.master" %>
In my WTF.mater i include css file:
<link href="~/css/reset.css" runat="server" rel="stylesheet" type="text/css" media="screen" />
when i run the site and look his source code in mozilla, i see css file link as:
<link href="css/reset.css" rel="stylesheet" type="text/css" media="screen" />
so, full url will be http://localhost:52912/website/css/reset.css
which is correct
-css file EXISTS
-No errors in firebug like "404 not found - reset.css"
-No errors when debugging project
I can't even open this file by direct link in browser ( http://localhost:52912/website/css/reset.css
) or by link in mozilla source code viewer
It returns http://localhost:52912/website/default.aspx?ReturnUrl=%2fcss%2freset.css
and i remains on the same page
I tried a whole bunch of various combinations and advices from google - nothing helps
What the..???
SOLVED: by adding
<location path="css">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
in web.config
That's because you have forms authentication turned on and you haven't allowed that css
folder public access. Try adding this to the web.config:
<location path="css">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With