1

When should I use Server.Transfer() method?

What is the advantage of using this method?

Paul Turner
  • 38,949
  • 15
  • 102
  • 166
Vishal Bhatia
  • 31
  • 1
  • 3
  • possible duplicate of [Response.Redirect vs. Server.Transfer](http://stackoverflow.com/questions/521527/response-redirect-vs-server-transfer) – Dan Diplo Jan 11 '11 at 10:18

2 Answers2

0

You could use Server.Transfer to execute some other server side page without changing the address on the client and without an additional redirect which is what Response.Redirect does.

Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
0

Server.Transfer allows you to redirect a request on the server-side to another resource on that server. This differs from Response.Redirect which redirects the client to another resource.

This means that processing of the requested resource is redirected to another existing resource. For example, you could have the request:

http://mydomain.com/users/100032

be handled by another resource on the server:

http://mydomain.com/users/100032/details

Server.Transfer will have the effect of both URLs returning the same response.

This differs from Response.Redirect, which has the effect of telling the client's browser "the resource you are requesting is at a different URL". In this case, the client's browser will make a new request to the URL and the client will see the URL change in their address bar to reflect this.

Paul Turner
  • 38,949
  • 15
  • 102
  • 166