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

Showing Answers 1 - 3 of 3 Answers

sujaykumar

  • Oct 11th, 2006
 

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.

  Was this answer useful?  Yes

mahesh l. nalawade

  • Oct 14th, 2006
 

actually response.redirect transfters control to specific page. while response.transfer is the method to transfer data of one page to another page.

  Was this answer useful?  Yes

cynthia justin

  • Oct 18th, 2006
 

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.

Sunil

  • Dec 26th, 2006
 

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().
 

  Was this answer useful?  Yes

gbengaoris

  • Jan 9th, 2007
 

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.

  Was this answer useful?  Yes

Rajesh K

  • Feb 14th, 2007
 

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

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions