-
I am trying to redirect a user and sending a querystring as well. I have formated the data to be send and tried to build a string. I get an error. The code is below:
Sub Back2Form
Form_Caption = Server.URLEncode(Form_Caption)
Form_Recipient = Server.URLEncode(Form_Recipient)
Form_Content = Server.URLEncode(Form_Content)
Form_Author = Server.URLEncode(Form_Author)
Val_Chk = Server.URLEncode(Val_Chk)
Val_Caption = Server.URLEncode(Val_Caption)
Val_Recipient = Server.URLEncode(Val_Recipient)
Val_Content = Server.URLEncode(Val_Content)
Val_Author = Server.URLEncode(Val_Author)
Response.Redirect "/newsInput.asp?FrmCap=" & Form_Caption & "&frmRec=" & Form_Recipient & "&frmCont=" & Form_Content
End Sub
The error is as follows:
Response object error 'ASP 0156 : 80004005'
Header Error
/Test/newsPost.asp, line 30
The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content.
What am I doing wrong?
Thank you,
Coopetj
-
Hi coopetj
Basically your problem is that you have written some content to the client and are then trying to re-direct to another page which the server doesn't let you. To get around this problem, use the buffer feature to compelte all scrpt before writting to the page. Use response.buffer = True
Hope this helps
Ian
-
What I did is put the code before any HTML code. Since it was a sub it didnt matter where I put it.
Thank you for your help.