Search This Blog

Thursday, September 16, 2010

Difference between server.transfer and response.redirect

1..Server.Transfer is used when redirecting the web page with in the same application whereas Response.Redirect is applicable towards the redirection of web page between 2 applications.
2. Response.redirect provides a round trip to the server and server.transfer does not. Response.Redirect will instruct browser to call a particular webpage.This will increase one request and one response between the client and server.
3. 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. 
4.Response.redirect will only only get method to post variables form one page to another means we need to give in query string if we want to pass some variables to next page.  
5. 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.
6.Server.transfer transfer the page processing from one page to another page without making a round trip back to the client where as response.redirect redirect to another URL and it make a round trip back to the client.
7.In case of Server.Transfer the browser's history is not updated but in Response.Redirect the browser's history is updated.
8.In case of Server.Transfer the url is not changed but in Response.Redirect the url is changed    

No comments:

Post a Comment