will any one please elaborate this
views:
115answers:
4Server.Transfer() only works with pages from your site, it means that the server starts rendering a new page from scratch.
Response.Redirect() is a normal redirection, which works with any URL.
Response.Redirect sends a '302 Moved Temporarily' response to the client, the client browser will then issue a request to that location.
Server.Transfer transfers the control from one page to the other on the server side, so the original Request and Response buffer streams remain as they are at the point the transfer is done.
This means that Response.Redirect requires a round trip to the client but a Server.Transfer does not. The other difference is that the Server.Transfer appears to the browser as the original url... e.g. consider Page1.aspx does a server.transfer to page2.aspx, In this case Page1.aspx shows in the address bar even though they are actually being shown Page2.aspx. If instead Page1.aspx did a Response.Redirect then Page2.aspx would be shown.
So depending on what you want to optimise Response.Redirect are better if you want to support bookmarking of pages correctly and Server.Transfers are better if you want to minimise client round trips to the server.
Oh, and do check out http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=15 it describes this much better with the caveats.