4
Reply

What is the difference between Server.Transfer and Response.Redirect?

purosotam gupta

purosotam gupta

10y
1.3k
0
Reply

    In Response.Redirect we can send request to get some html/aspx page on same server or another server. In Server.Transfer we can send request to same server only. In Response.Redirect additional roundtrip is involved in server.transfer it reduces it. In Response.Redirect current Url history updated but in Server.Transfer current URL history is not updated

    In Response.Redirect we can send request to get some html/aspx page on same server or another server. In Server.Transfer we can send request to same server only. In Response.Redirect additional roundtrip is involved in server.transfer it reduces it. In Response.Redirect current Url history updated but in Server.Transfer current URL history is not updated

    Both Response.Redirect and Server.Transfer methods are used to transfer a user from one web page to another web page. Both methods are used for the same purpose, but still there are some differences as follows.The Response.Redirect method redirects a request to a new URL and specifies the new URL while the Server.Transfer method for the current request, terminates execution of the current page and starts execution of a new page using the specified URL path of the page.

    Response.Redirect Response.Redirect() will send you to a new page, update the address bar and add it to the Browser History. On your browser you can click back. It redirects the request to some plain HTML pages on our server or to some other web server. It causes additional roundtrips to the server on each request. It doesn't preserve Query String and Form Variables from the original request. It enables to see the new redirected URL where it is redirected in the browser (and be able to bookmark it if it's necessary). Response. Redirect simply sends a message down to the (HTTP 302) browser. Server.Transfer Server.Transfer() does not change the address bar, we cannot hit back.One should use Server.Transfer() when he/she doesn't want the user to see where he is going. Sometime on a "loading" type page. It transfers current page request to another .aspx page on the same server. It preserves server resources and avoids the unnecessary roundtrips to the server. It preserves Query String and Form Variables (optionally). It doesn't show the real URL where it redirects the request in the users Web Browser. Server.Transfer happens without the browser knowing anything, the browser request a page, but the server returns the content of another.for more difference go on this link http://dotnet-munesh.blogspot.in/2013/12/difference.html