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

Response.Redirect

Status
Not open for further replies.

lb1

Technical User
Apr 19, 2002
109
US
I have an ASP page that I would like to redirect if one value is not correct. I am using the following code at the beginning of my page code:

Response.buffer = true
if session("CurrentSessionID") = "" then
Response.Flush
Response.Redirect("index.asp")
end if

But I always get the error ==> The HTTP headers are already written to the client browser.......
Does somebody could give me a hint on how to solve my problem?
Thanks
Louis


 
take out the .flush
Response.buffer = true
if session("CurrentSessionID") = "" then
Response.Redirect("index.asp")
end if
You cannot mandate productivity, you must provide the tools to let people become their best.
-Steve Jobs
admin@onpntwebdesigns.com
 
also something worth mentioning
you can not do a Response.Redirect once anything has been written to the browser!

in short what you are doing here must come before any tag or response.write.
any tag meaning even the <html>


You cannot mandate productivity, you must provide the tools to let people become their best.
-Steve Jobs
admin@onpntwebdesigns.com
 
Thanks.
It works fine when I moved it to the first line
Lb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top