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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTTP headers are already written

Status
Not open for further replies.

sharonc

Programmer
Jan 16, 2001
189
US
I'm doing a redirect

Response.Redirect("//seims/project3_local")

and I'm receiving the following error, does someone know how to fix this error. It works great in my other programs.

Response object error 'ASP 0156 : 80004005'

Header Error

/Project3_Local/HealthProviders/LoadData.asp, line 244

The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content.
 
There are two solutions to this problem:

1) Have all of your code, including the redirect above the <html> tag in your page

2) At the very top of your page (under the language directive), insert this line:
<%
Response.buffer = true
%>
This will allow the whole page to execute on the server before sending and information (headers, etc) to the client.
 
That error usally means that you have written something out the page before you attempt to redirect. Once you put something on the page you can no longer use the redirect methodl.

Roj
 
Use the
Response.Buffer = true at the beginning of the asp

and when you want to redirect use

Response.Flush
Response.Redirect

Hope this helps... ________
George, M
 
thank you for your help, this fixed my problem
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top