2010-11-24 79 views
2

我试图用这样的:ASP.NET的customErrors谷歌浏览器显示为纯HTML

<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下,但在谷歌浏览器7

失败

您可以使用此链接测试:http://www.buzzmath.com/this_page_does_not_exist.aspx

任何想法? 卡尔

+0

什么是在Chrome中显示的“纯html”? – 2010-11-24 12:12:34

+0

@ mlms13:要进行测试,您可以使用此链接: http://www.buzzmath.com/this_page_does_not_exist.aspx – Malartre 2010-11-24 18:28:40

回答

2

没有内容类型在响应中设置和Chrome默认设置为文本而Firefox和IE呈现为HTML。

尝试将Content-Type设置为text/html。你

而且应该验证您的网页,它似乎具有能造成这种“怪异”的行为不少问题。