Qus:    What is the difference between Response.Redirect and Server.Transfer?
Nov 03, 2020 04:13 2 Answers Views: 95 ARUNA

 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.

Prev Next
Answers (2)
NAIDU Nov 04, 2020 00:13
Answer:   Response.Redirect basically redirects the user’s browser to another page or site. The history of the user’s browser is updated to reflect the new address as well. It also performs a trip back to the client where the client’s browser is redirected to the new page.
Whereas, Server.Transfer transfers from one page to the other without making any round-trip back to the client’s browser. The history does not get updated in the case of Server.Transfer.

PARTH Nov 10, 2020 08:20
Answer:   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.

Post Your Answer
Guest User

Not sure what course is right for you?

Choose the right course for you.
Get the help of our experts and find a course that best suits your needs.


Let`s Connect