Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTTP Header error in ASP 1

Status
Not open for further replies.

pawanjit

Programmer
Jan 26, 2001
3
US
I am getting the following error when I use Response.Redirect statement. What is causing this error??

The error is:

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

Can anyone help?

Regards,

Pawan
 
Pawan,
I'm relatively new to ASP so I'm not sure if this is the actual cause or not...

I recieved that same error on the Response.redirect and it was caused by using Response.write in the same block of code. I removed the response.write and it worked fine.

Hope this helps...finny
 
pawanjit,

The problem you are having is due to using the Response.redirect object after you have sent the HTML headers to the browser.

You need to put your redirect code at the very top of your HTML. IE:

<%
'ASP Code
Response.redirect &quot;SomeURL&quot;
%>
<HTML>
<HEAD>
<TITLE>Page Title</TITLE>
</HEAD>
<BODY>
Page Content
</BODY>
</HTML>

That should do it.
Ahdkaw
&quot;What would you expect from a bunch of monkeys?&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top