Saturday 1 October 2011

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


Following are the major differences between them:
  Response.Redirect sends message to the browser saying it to move to some different page, while Server.Transfer does not send any message to the browser but rather redirects the user directly from the server itself. So in Server.Transfer
there is no round trip while Response.Redirect has a round trip and hence puts a load on server.
  Using Server.Transfer you cannot redirect to a different from the server itself. This cross server redirect is possible only using Response.Redirect.
  With Server.Transfer you can preserve your information. It has a parameter called as "preserveForm". So the existing query string etc. will be able in the calling page.

No comments:

Post a Comment