IT SOLUTIONS
Your full service technology partner! 
-Collapse +Expand
ASP Classic
Search ASP Classic Group:

Advanced
-Collapse +Expand ASP Classic Store

Prestwood eMagazine

August Edition
Subscribe now! It's Free!
Enter your email:

   ► KBWebsite Scri...ASP Classic   Print This     
Next Random Article Next Random Tidbit || Change Topic Random From All
  From the September 2010 Issue of Prestwood eMag
 
ASP Classic:
Response.Redirect vs. Server.Transfer
 
Posted 13 years ago on 8/7/2007 and updated 1/28/2009
Take Away:

A quick comparison.

KB100665

A Response.Redirect will create a new HTTP request, using the argument of the call as the URL, and the user is now viewing the page he or she was redirected to as if they typed the URL into their address bar.

Server.Transfer transfers the execution of the first page to the page supplied in the argument of the call, without the user ever knowing there is more than one script being used.  Also variables received from form posts and the query string from the original page can be used in the second page.

Also, if you do a server.transfer into a folder (ex. /boards/) then all the links within that destination page must use relative addressing or they will not work. So, within /boards/default.asp you need to change links to pages such as search.asp and to images/title.gif to /boards/search.asp and /boards/images/title.gif.


Comments

0 Comments.
Share a thought or comment...
 
Write a Comment...
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P191A1
Enter key:
KB Post Contributed By Adam Lum:

Adam Lum is a part time developer for Prestwood Software and participates in this online community when time allows. His day-to-day work is C# coding but his current intrests (right now) are Ruby on Rails and iOS programming with Objective-C.  He has also coded several projects in Java, C++, ASP Classic, and PHP.  His personal website can be found at adamlum.com.

Visit Profile


Linked Certification Question(s)

The following are practice certification questions with answers highlighted. These questions were prepared by Mike Prestwood and are intended to stress an important aspect of this KB post. All our practice questions are intended to prepare you generally for passing any certification test as well as prepare you for professional work.

Intermediate

1 Intermediate Level Question

Question #1: Multiple Choice

What is the difference between Response.Redirect and Server.Transfer?

Answer:
1. 

Response.Redirect will create a new HTTP request as if the user typed the URL into their address bar.

Server.Transfer transfers the execution of the page without the user knowing there is more than one script being used. However, form post variables and the query string from the original page cannot be used.

2. 

Server.Transfer will create a new HTTP request as if the user typed the URL into their address bar.

Response.Redirect transfers the execution of the page without the user knowing there is more than one script being used. In addition, form post variables and the query string from the original page can be used.

3. 

Response.Redirect will create a new HTTP request as if the user typed the URL into their address bar.

Server.Transfer transfers the execution of the page without the user knowing there is more than one script being used. In addition, form post variables and the query string from the original page can be used.

4. 

None of the above, there is no real difference.


 KB Article #100665 Counter
11738
Since 4/2/2008
Go ahead!   Use Us! Call: 916-726-5675  Or visit our new sales site: 
www.prestwood.com


©1995-2020 Prestwood IT Solutions.   [Security & Privacy]