Every web developer must have heard
Response.Redirect, but not everybody has used
Server.Transfer. Ok, that might be a wrong statement.
The point is, both
Server.Transfer will send users to another page, what really are the differences? Here you go:
Server.Transferdoesn’t actually redirect user’s browser.
The transfer occurs on server’s side and do not first reach the client. So, calling
Server.Transfer("about.aspx")from contact.aspx’s page load event will send user directly to
about.aspxwithout round trip to the client.
Server.Transfercan’t send users to external site other than yours.
Since it occurs on server’s side, we can’t use it to transfer to external side other than our domain.
Server.Transferdoesn’t change the original Url.
Take an example above, when user requests
contact.aspx, the server will return
about.aspxcontent, however, the url will still be
Server.Transfercan also transfer form data and query strings.
If there is any form data or query string in
contact.aspx, it will also get transferred to