When accessing an asp page, it prompts Response object error ASP 0156: 80004005 HTTP header error?, line 0 has output the HTTP header to the client browser. Any modifications to HTTP headers must be made before outputting the page content.
In fact, this kind of problem is due to caching problems. You can refer to the following methods to solve it:
Some ASP pages will have a Response object error 'ASP 0156: 80004005' and an HTTP header error when they are opened for the first time, but they are normal again after refreshing. The solution is as follows
Copy the code code as follows:
Response.Buffer = True
'It should be this line, it will be ok if you remove it
'If it still doesn't work, just
Response.Buffer = True
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "No-Cache"
'Remove them all. This is used to not cache the page. Removing it should not affect the website.
This error occurs because the Web server uses an HTTP header to set up the client browser. The Web server then attempts to reset the client's browser by using additional HTTP headers (for example, when an HTTP header is issued after the browser sets content-type = text/html). An example is when processing an ASP page before including an HTML tag or any other server-side script Response.Redirect statement.
Note This can also occur if you upgrade a computer that is running Microsoft Windows NT 4.0 to Microsoft Windows Server 2003.
An example is when processing an ASP page before including an HTML tag or any other server-side script Response.Redirect statement.
The following properties and methods of ASP of the Response object write HTTP headers:
Response.AddHeader
Response.CacheControl
Response.CharSet
Response.ContentType
Response.Expires
Response.ExpiresAbsolute
Response.Redirect
Response.Status
Back to top
solution
To resolve this issue, set HTTP headers, such as a Redirect statement or cookie information before sending HTML output.
For example, to avoid this error with a redirect, limit the buffer or ASP page's processing and then issue the redirect after processing. There are two ways to accomplish buffering: at the page level or at the application level.
Note that all ASP scripts are issued after the redirection. If the ASP page is redirected before it is issued to an ASP script, the ASP code is not processed.
When they are processed on an application level, all ASP pages in the Web application are buffered. To set buffering on an application level, follow these steps: 1. In Microsoft Management Console (MMC), locate the Web site where the Web application resides.
2. Click to expand the website to display the virtual directory and web application.
3. Right-click the Web application, and then click Properties.
4. On the Virtual Directory tab, click Configure.
Note that if the Configure button is unavailable, the virtual directory is not a Web application. Click Create to create the virtual directory to the Web application.
5. In the ApplicationConfiguration@@ dialog box, on the App Options tab, click Enable Buffering.
To set the page level for buffering, add code after the @LANGUAGE line on the ASP page as shown below:
<% @LANGUAGE = "VBScript" %><% Response.Buffer = True %>Other ASP/Clientside scripts or HTML ...<% Response.Redirect %>As the following code demonstrates, in addition, cookie settings can be used at page level, on buffer. This code snippet writes the cookie before sending the <HTML> tag (element).
Response.Cookies("Name")=value<HTML>...content...</HTML>
If you are using a small whirlwind, it is missing components.