first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

VBScript and ASP Code: Flippant Remarks about the Response.Buffer Property, the Response.Redirect() Method and Windows 2000

You know your code is running on an older, Windows NT, server when you see this error:

Response object error 'ASP 0156 : 80004005 
Header Error...
The HTTP headers are already written to the client browser.
Any HTTP header modifications must be made before writing page content.

The implication is that your ASP page is rendering HTML before it encounters the Response.Redirect() method. Microsoft explains in detail why this is problematic in KB Article Q159402 ("HOW TO: Use Response Redirect in a Server Script").

This problem is usually not encountered in Windows 2000 (and, I assume, versions above) as the Buffer property of the Response object is set to true in Windows 2000. To be very safe this form is suggested:

<%
    Response.Buffer = True
    ...
%>
    <h1>HTML Rendering Here</h1>
<%
    Response.Clear
    Response.Redirect "someother.asp"
%>
mod date: 2002-05-16T23:44:29.000Z