What are Difference between Server.Transfer() and Response.Redirect()
This is very common question, interviewers mostly ask this question, if you are preparing for interview you must know difference between these two. here is list of differences between Server.Transfer() and Response.Redirect.
These are used for transfer/redirect from one page to another page , but here is come difference , how to work below
- Response.Redirect is used to redirect the user’s browser to another page or site.
- Response.Redirect updates the client’s url history in browser list or current url.
- Response.Redirect() sends the request to the browser.
- Response.Redirect can redirect page to any page that can be your application page or can be any other external pages.
- It takes roundtrip back to the client browser.
- Response.Redirect() is a method of request object which is an instance of System.HttpRequest class.
- Server.Transfer doesn’t update the client’s url history in browser list or current url.
- It can only take you to the pages in current one application
- Server.Transfer() is a method of server() is a method of server object which is an instance of System.Web.Http Server Utility class.
- It provides a faster response with a little less overhead on the server compare to Response.Redirect().
- It does not takes roundtrip back to the client browser.