Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ASP.NET自定义错误在Google Chrome中显示为纯HTML_Asp.net_Google Chrome - Fatal编程技术网

ASP.NET自定义错误在Google Chrome中显示为纯HTML

ASP.NET自定义错误在Google Chrome中显示为纯HTML,asp.net,google-chrome,Asp.net,Google Chrome,我试着用这样的方法: <customErrors defaultRedirect="/Error.htm" mode="On" redirectMode="ResponseRewrite"> <error statusCode="401" redirect="/Error401.htm"/> <error statusCode="403" redirect="/Error403.htm"/> <error status

我试着用这样的方法:

<customErrors defaultRedirect="/Error.htm" mode="On" redirectMode="ResponseRewrite">
      <error statusCode="401" redirect="/Error401.htm"/>
      <error statusCode="403" redirect="/Error403.htm"/>
      <error statusCode="404" redirect="/Error404.htm"/>
      (...)
</customErrors>

(...)
它在IE 8和Firefox 3.6下运行良好,但在Google Chrome 7下运行失败

您可以使用此链接进行测试:

有什么想法吗?
Carl

响应中未设置任何内容类型,Chrome将其默认为文本,而Firefox和IE将其呈现为HTML

尝试将内容类型设置为text/html


你也应该验证你的页面,它似乎有相当多的问题导致这种“wierd”行为。

Chrome中显示的“纯html”是什么?@mlms13:要测试,你可以使用以下链接:页面通过w3c验证程序验证。我会仔细检查Thank.IIS是否应该设置此项,我会搜索为什么它本周没有放置任何内容类型,谢谢。@Malartre:您找到了此问题的根本原因了吗,即为什么IIS没有设置.htm文件的内容类型?