GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Microsoft  >  ASP.NET
Go To First  |  Previous Question  |  Next Question 
 ASP.NET  |  Question 86 of 164    Print  
What is the difference between Response.Redirect and Server.Transfer

  
Total Answers and Comments: 6 Last Update: February 14, 2007     Asked by: Santhosh 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
October 11, 2006 10:08:40   #1  
sujaykumar        

RE: What is the difference between Response.Redirect a...
Response.Redriect means it can redirect the page which is located inside the application directory.server.transfer means it goes to another directory of the file.
 
Is this answer useful? Yes | No
October 14, 2006 16:03:22   #2  
mahesh l. nalawade        

RE: What is the difference between Response.Redirect a...
actually response.redirect transfters control to specific page. while response.transfer is the method to transfer data of one page to another page.
 
Is this answer useful? Yes | No
October 18, 2006 11:06:03   #3  
cynthia justin        

RE: What is the difference between Response.Redirect a...
Server.Transfer transfers page processing from one page directly to the next page without making a round-trip back to the client's browser. This provides a faster response with a little less overhead on the server. Server.Transfer does not update the clients url history list or current url. Response.Redirect is used to redirect the user's browser to another page or site. This performs a trip back to the client where the client's browser is redirected to the new page. The user's browser history list is updated to reflect the new address.
 
Is this answer useful? Yes | No
December 26, 2006 12:04:46   #4  
Sunil        

RE: What is the difference between Response.Redirect a...
As simple as this
Server.Transfer() send the request to server
Response.Redirect() sends the request to Browser
So If the Request is made for the location outside the Server it fails. so you need to use Respons.Redirect().

 
Is this answer useful? Yes | No
January 09, 2007 20:26:52   #5  
gbengaoris Member Since: June 2006   Contribution: 2    

RE: What is the difference between Response.Redirect a...

Hi

There are 4 main differences between Response.Redirect() and Server.Transfer().

(1) Response.Redirect() can direct you to any page. ie. pages that are part of your application and external pages whereas Server.Transfer() can only take you to pages within your application.

(2) Response.Redirect() updates the Browser whereas Server.Transfer() does not.

(3) Response.Redirect() does a round-trip to the server before it can load the requested page whereas Server.Transfer() loads the page without round-trip. Hence Server.Transfer() is faster than Response.Redirect().

(4) Response.Redirect() is a method of Request object which is an instance of System.HttpRequest class while Server.Transfer() is a method of Server object which is an instance of System.Web.HttpServerUtility.


 
Is this answer useful? Yes | No
February 14, 2007 07:08:18   #6  
Rajesh K        

RE: What is the difference between Response.Redirect a...
Response.Redirect( http://www.geekinterview.com )This will redirect to the website that is other than the application directory:Server.Transfer( http://www.geekinterview.com )Invalid path for child request 'http://www.geekinterview.com'. A virtual path is expected.It through a exception like above...bcz it never transfer other than current virtual path..We can change this to ..Server.Transfer( ../JF-Orders/OrdersubscriptionList.aspx )It will execute..bcz the site from current virtual path
 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape