I am working on a web development project and I wanted to find out what is the difference between Server.Transfer and Response.Redirect? What are advantages and disadvantages of each?
Jonathan from Montgomery County
I am working on a web development project and I wanted to find out what is the difference between Server.Transfer and Response.Redirect? What are advantages and disadvantages of each?
Jonathan from Montgomery County
Comments are closed.
Hi Jonathan
Response.Redirect simply sends a message (HTTP 302) down to the browser which redirects you to the new page. It updates the address bar and adds it to the Browser History.
Server.Transfer happens without the browser knowing anything, the browser requests a page, but the server returns the content of another. It does not change the address bar or add it to the Browser History.
I use Server.Transfer() when I don’t want the user to see where I am going, usually on a “loading” type page.