Difference between Server.Transfer() And Response.Redirect()

  • Thread starter Thread starter batista
  • Start date Start date
B

batista

Hello All,

I want to know the Difference Between

Server.Transfer() And Response.Redirect()?
 
Response.Redirect() send a "move" command to the client that sends it to the
new page.

Server.Transfer() does this at the server level.
 
Batista,

When a Response.Redirect is fired the client has posted back to the server
(let's use a post back from a hypothetical "Page1.aspx" for this example)
and then the server sends back the "Page1.aspx" response to the client
machine which tells the client to move to the new page, Page2.aspx.

With Server.Transfer the client posts back to the server, Page1.aspx, but
instead of sending back Page1.aspx, the server compiles and sends back
Page2.aspx circumventing the trip to the client. As far as the client
browser knows it's still on Page1.aspx.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
Server.Transfer() transfers control, on the server, to another page.
Response.Redirect() sends redirect to the client.
In other words, Server.Transfer() transfers to another page without
involving the client.
 
Back
Top