2011-07-05 46 views
0

I'me收到以下错误:HTTP头问题

Response object error 'ASP 0156 : 80004005' 

Header Error 

/includes/page_language.asp, line 3 

The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content. 

但是,页面的第一行是文档类型:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

的下一行是:

<!-- #include file = "includes/page_language.asp" --> 

page_language.asp文件中的前4行是:

<% 
response.codePage = 65001 
response.charset = "utf-8" 
%> 

所以它不喜欢Response.Charset的=“UTF-8” - 但这些行之前没有HTML来造成问题...

该错误仅发生的第一时间加载一个页面 - 当这种情况发生时按下刷新并且页面加载正常。该网站工作正常,但我们昨天注意到了这一点。

UPDATE: 现在我已经改变了的index.asp阅读:

<% 
response.codePage = 65001 
response.charset = "utf-8" 
%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

但我仍然获得在Response.Charset都行错误.... 我难住了 - 任何建议将不胜感激!

+0

除去最后固定固定Response.Charset的= “UTF-8” 和添加 JezB

回答

0

最后,除去Response.Charset的= “UTF-8”,增加

<meta http-equiv="content-type" content="text/html;charset=utf-8"> 
0

尝试使用萤火虫并测试response.charset。看就像是 不HTTP Content-Type charset<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />