Monday, February 26, 2007

Response.Redirect Vs Server.Transfer

Response.Redirect will instruct browser to call a particular webpage. Then Request comes to browser and brower requests the the new page. This will increase one request and one response between the client and server.

· Resonse.redirect can be used both for aspx and html pages.But server.transfer is only used for aspx pages it will not work for html pages.

· Response.redirect supports only get method to send variables form one page to another page we need to append the data in query string

· But in server.transfer if we selected the second attribute to "TRUE" then it will post all the variable using the post method.

· Response.Redirect can be used to redirect to external web sites where as the Server.Transfer can be used only to transfer to other pages of the same web site.

· response.redirect has no support for encapsulating the code.whereas with a server.transfer we can overcome these overheads because server.transfer gets teh page from the server itself without needing a rountrip to the client.


· Response.redirect updates the url with newpage name in browser address bar. But Server.Transfer keeps oldpage url in address bar.