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!

How to Transfer or Redirect to another ASP 1

Status
Not open for further replies.

JohnBates

MIS
Feb 27, 2000
1,995
US
Hi ASP experts -

I have several questions but I don't want to be greedy.

This ASP just Inserts a record into my SQL database.
After the Insert, I want to transfer to another ASP which
will display some info, telling the user the number that was assigned to their Request.
This ASP has no form, no buttons to click

so, after the Insert statement, I have...

Response.Redirect "ISSystemsAccessDisplay.asp"

get error... "Response object error ASP0156:80004005
The HTTP Headers are already written to the client browser. Any HTTP header modifications must be made before writing
page content"

How can I move on to the next ASP (without having an OnSubmit) ?

Thanks, John


 
Hi

Is the response.redirect after the start of the HTML code?

If so it will be writing those headers again. Move the respinse.redirect above the first
Code:
<HTML>
tag and it should work fine. Derren
[The only person in the world to like Word]
 
You are doing the Response.Redirect after the page has already started generating.

Add the line
<%
Response.Buffer = True
%>

to the very top line of your asp page. This will allow you to Response.Redirect freely from anywhere in the page! Let me know if this helps.

Cheers! Brett Birkett B.Comp
Systems Analyst
 
Darren's solution will work if you can move the code to above the <html> tag. If you can't, put Response.Buffer=true at the top of your asp page. This will allow the entire page to process before sending header information, etc to the client.

 
Thanks Derren, Bret and Juanita for your ideas.

But as I said in my post... &quot;This ASP has no form, no buttons to click&quot;. I'm at home now, but I don't think this ASP has an <HTML> tag. All it does is reference hidden fields from the previous pages' form and write 1 record to my database. Now, I simply want to transfer to another ASP after the Insert.

Maybe I could design it in a better way...

Bret, I will add the Response.Buffer = True tomorrow
to see what happens then.

Thanks, John



 
No worries John,

I can almost guarantee you that it will work. Let me know :) Brett Birkett B.Comp
Systems Analyst
 
yes you have to put
<%
Response.Buffer = True
%>

at the top as Birkett said ans just before using response.redirect .. use response.clear. This clear all the headers which are genrated and hence will solve the problem .. In this way u can use response.redirect anywhere in the page ....

cheers!
srinu...
 
Thanks to everyone who replied.

and a BIG thank you to BBirkett (Bret). The
Response.Buffer = True solved my problem.

As you can tell... I'm new at this stuff.

Thanks, John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top