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

response.redirect question 2

Status
Not open for further replies.

lovejaeeun

Technical User
Jan 13, 2004
60
0
0
US
If I do a response.redirect, does the code that follows this statement still get exectued?

If it does, what is the equivalent of the exit function statement that i can use in my ASP page to stop processing the rest of the code?

thanks,

lovejaeeun
 
Hi lovejaeeun,

basically all the statements before the redirection will be processed. Anything after will not be processed since processing is now redirected to the new page.

You have to note that the redirection will not bring across the variables values. You can use Session variables or Querystrings to "transfer" variables across.

Hope this helps.

rgds,
Nickson
 
Following on to WebNickson's post:

You can always make sure by adding

response.redirect "mynewpage.asp"
response.end

hth

simon
 
got it!

so you're saying that the response.redirect is effectively the same as an exit function statement in VB?

and just to make absolutely sure, i add response.end?

thanks for your posts!!
 
I sugets to allways use Response.End when using redirection. I've had some problems long time ago with that and seen some of my friends having same problems now. Cut they didnt placed Response.End as next tile in the code.
Somehow the redirection it doesnt work.

But if you want to transfer whole Request(post data) to another file then you can use Server.Transfer "filename.asp
". This way you can still use your Request object.

________
George, M
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top