Response.Redirect
involves an extra round-trip to the server whereas
Server.Transfer
conserves server resources by avoiding that extra round-trip.
Server.Transfer
just changes the focus of the page by directly communicating with server.
Here, read:
Response.Redirect[
^]
Vs
Server.Transfer[
^]
Response.Redirect sends HTTP code 302 down to the users browser along with the new URL location of the wanted page. HTTP Code 302 actually means ' The requested resource resides temporarily under a different URI'.
BUT
Server.Transfer do not initiates another request to the server, but the original request is simply rewritten and transfered to some other page on the same server.
Then these:
What is the difference between Server.Transfer and Response.Redirect methods? [
^]
Difference between Server.Transfer() and Response.Redirect()[
^]
Summary:
Response.Redirect should be used when:
- we want to redirect the request to some plain HTML pages on our server or to some other web server
- we don't care about causing additional roundtrips to the server on each request
- we do not need to preserve Query String and Form Variables from the original request
- we want our users to be able to see the new redirected URL where he is redirected in his browser (and be able to bookmark it if its necessary)
Server.Transfer should be used when:
- we want to transfer current page request to another .aspx page on the same server
- we want to preserve server resources and avoid the unnecessary roundtrips to the server
- we want to preserve Query String and Form Variables (optionally)
- we don't need to show the real URL where we redirected the request in the users Web Browser