Tuesday 9 August 2011

Difference b/w Server.Transfer and Response.Redirect?

Response.Redirect :
  1.     we want to redirect the request to some plain HTML pages on our server or to some other web    server.
  2.     we don't care about causing additional roundtrips to the server on each request.
  3.     we do not need to preserve Query String and Form Variables from the original request.
  4.     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 :
  1.     we want to transfer current page request to another .aspx page on the same server
  2.    we want to preserve server resources and avoid the unnecessary roundtrips to the server.
  3.     we want to preserve Query String and Form Variables (optionally).
  4.     we don't need to show the real URL where we redirected the request in the users Web Browser.

No comments:

Post a Comment