资源解释为样式表,但在ASP.NET IIS中使用MIME类型text / html传输 [英] Resource interpreted as Stylesheet but transferred with MIME type text/html in ASP.NET IIS

查看:2214
本文介绍了资源解释为样式表,但在ASP.NET IIS中使用MIME类型text / html传输的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个登录页面,当执行时页面被从 css 中删除​​。



这个消息从chrome调试器。

  

< head id =Head1runat =server>
< title> CalibPro< / title>
< link href =css / Login.css =stylesheettype =text / css/>
< link href =css / Common.css =stylesheettype =text / css/>
< / head>



根据@robx建议编辑。

解决方案

看起来像我的问题是在你的IIS配置。它可能被配置为传递具有text / html MIME类型的.css文件。



尝试访问Web服务器上的MIME类型配置,看看是否可以发现任何东西。



.css文件的正确MIME类型为text / css。



使用一些HTTP嗅探器(例如fiddler)对HTTP标头参数进行处理。



更新:接受的答案应该是@ breet-pennings!
只是提供静态内容,错误自动消失:


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.

解决方案

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 @breet-pennings! Just providing static contents, the error vanished automatically:

这篇关于资源解释为样式表,但在ASP.NET IIS中使用MIME类型text / html传输的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆