Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

What is the difference between server, transfer and response and redirect?

user-image
Question added by Asif Ali , Software Engineer , BroadPeak Technologies
Date Posted: 2013/08/06
Shahzad Khan
by Shahzad Khan , Sr. Software Developer , Mar Incorporated

Both methods redirect user to a different page. Response.Redirect does a round trip between browser and server and you are able to see new URL in your browser. Server.Transfer is a server side action where browser is totally unaware of new URL but able to render new page.

Faisal Shah
by Faisal Shah , Senior Web Architect , Innomar Strategies Inc

In addition, there is a slight trick when it comes to AJAX. Response.Redirect can be problematic in that scenario

Anshul Tiwari
by Anshul Tiwari , Software Developer , RTSPL

In earlier versions of IIS, if we wanted to send a user to a new Web page, the only option we had was Response.Redirect. While this method does accomplish our goal, it has several important drawbacks. The biggest problem is that this method causes each page to be treated as a separate transaction. Besides making it difficult to maintain your transactional integrity, Response.Redirect introduces some additional headaches. First, it prevents good encapsulation of code. Second, you lose access to all of the properties in the Request object. Sure, there are workarounds, but they're difficult. Finally, Response.Redirect necessitates a round trip to the client, which, on high-volume sites, causes scalability problems. As you might suspect, Server.Transfer fixes all of these problems. It does this by performing the transfer on the server without requiring a roundtrip to the client.

More Questions Like This

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.