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

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

问题描述

我在执行时有一个登录页面,该页面从 css 中剥离出来.

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

我从 chrome 调试器中发现了这条消息.我正在使用 asp.net 2008.

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

有什么想法吗?

<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>

根据@robx 建议进行编辑.

edited as per @robx advice.

推荐答案

在我看来,问题出在您的 IIS 配置中.它可能被配置为传送具有 text/html MIME 类型的 .css 文件.

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

尝试转到 Web 服务器上的 MIME 类型配置,看看是否可以在其中发现任何内容.

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

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

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

您还可以使用一些 HTTP 嗅探器(例如 fiddler)查看 HTTP 标头参数.

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

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

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

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

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