Difference in Server.Transfer and Response.Redirect

  • 22-01-2014, 20:22 PM
    Posts: 1

    Hello, what is the difference between  Response.Redirect and Server.Transfer? Why most people prefer using Response.Redirect?

  • 22-01-2014, 23:01 PM
    Posts: 6

     Welcome Mitchel.

    The basic difference is that Response.Redirect will create a new request to the server while Server.Transfer simply changes the content of the response with the one the new page would respond. For example using Response.Redirect("NewPage.aspx") from the CurrentPage.aspx, will send a redirect message to the client and create a brand new request while Server.Transfer will show the CurrentPage.aspx's content while maintaining the same request (the same url). As a result Server.Transfer reduces the server's traffic.

    I'm not sure if it is true that most developers prefer Response.Redirect, but  you should keep in mind that using Server.Transfer in pages where urls are important is not suggested as you may end up showing different things than the url was meant to represent and ruining the query string information.

  • 27-01-2017, 12:10 PM
    Posts: 0

    You make thigns so clear. Thanks for taking the time!

Post Reply