Search code examples
asp.netcssiisstylesheetmime-types

Resource interpreted as Stylesheet but transferred with MIME type text/html in ASP.NET IIS


i am having a login page when executed the page is stripped out of css.

I found out this message from from chrome debugger. I am using asp.net 2008.

Any ideas?

<head id="Head1" runat="server"> 
<title>CalibPro</title> 
<link href="css/Login.css" rel="stylesheet" type="text/css" /> 
<link href="css/Common.css" rel="stylesheet" type="text/css" /> 
</head>

edited as per @robx advice.


Solution

  • Seems to me like the problem is in your IIS configuration. it might be configured to deliver .css files with text/html MIME type.

    Try going to the MIME types configuration on the web server and see if you can spot anything there.

    The correct MIME type for .css files is text/css.

    You can also have a look on the HTTP header parameters with some HTTP sniffer such as fiddler.

    Updating: The accepted answer should be the one pointed by @brett-pennings! Just providing static contents, the error vanished automatically.