Asp page prompts Response object error ASP 0156: 80004005 HTTP header error

Source: Internet
Author: User

In fact, this type of problem is caused by cache issues. You can refer to the following methods to solve it:

When some ASP pages are opened for the first time, the Response object error 'asp 0156: 8080' HTTP header error will occur, but it is normal after refreshing. The solution is as follows:Copy codeThe Code is as follows: Response. Buffer = True
'It should be this line. If this line is removed, it will be OK.

'If not
Response. Buffer = True
Response. ExpiresAbsolute = Now ()-1
Response. Expires = 0
Response. CacheControl = "no-cache"
Response. AddHeader "Pragma", "No-Cache"
'Remove all. This is not used to cache pages. Removing it should not affect websites.

This error occurs because the Web server uses an HTTP header to set the client browser. The Web server then tries to reset the client's brower by using other HTTP headers (for example, when an HTTP header sets the browser content-type and then redirects it to it) = text/html. One example is to process an ASP page before it contains an HTML Tag or any other server-side script Response. Redirect statement.

Note This also happens if you upgrade to Microsoft Windows Server 2003 to run a Microsoft Windows NT 4.0 Computer.

One example is to process an ASP page before it contains an HTML Tag or any other server-side script Response. Redirect statement.

The following ASP attributes and methods of the Response object are written to the HTTP header:
Response. AddHeader
Response. CacheControl
Response. CharSet
Response. ContentType
Response. Expires
Response. ExpiresAbsolute
Response. Redirect
Response. Status
Back to Top

Solution
Before resolving this problem, send the HTML output to set the HTTP title, such as the Redirect statement or cookie information.

For example, to avoid this error and redirection, the buffer or ASP page limits its processing process and then processes redirection after it is issued. There are two ways to complete buffering: page-level or application-level.

Make sure that all ASP scripts are redirected. If you send ASP page redirection to an ASP script, ASP code is not processed.

When processing them, an application level will buffer all ASP pages in the Web application. To set an application level, perform the following steps for caching: 1. On the Microsoft Console (MMC), locate the Web site to reside in the Web application.
2. Click to expand the website to display virtual directories and Web applications.
3. Right-click the Web application and click Properties.
4. On the virtual directory tab, click Configure.

If the configuration button is unavailable, check whether the virtual directory is a Web application. Click create virtual directory to create a Web application.
5. In the ApplicationConfiguration @ dialog box, click Enable Buffering on the App option card.
To set the page level, add the following code After buffering the @ LANGUAGE Line on the ASP page:
<% @ LANGUAGE = "VBScript" %> <% Response. buffer = True %> Other ASP/Clientside scripts or HTML... <% Response. redirect %> If the following code demonstrates, it can be used to set the page level and buffer on the Cookie. The <HTML> flag (element) is sent before the code snippet is written into the Cookie ).
Response. Cookies ("Name") = value <HTML>... content... </HTML>

Components are missing if a small tornado is used

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.