开发者

Server.Transfer Method

开发者 https://www.devze.com 2023-02-03 09:10 出处:网络
When should I use Server.Transfe开发者_JS百科r() method? What is the advantage of using this method?You could use Server.Transfer to execute some other server side page without changing the address

When should I use Server.Transfe开发者_JS百科r() method?

What is the advantage of using this method?


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号