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

What is the difference between Server.Transferand Response.Redirect?

+3
source share
4 answers

Response.Redirect sends a response "302 Moved Temporarily" to the client, the client browser will then issue a request to this place.

Server.Transfer transfers control from one page to another on the server side, so the original request and response buffer streams remain the same as they were when the transfer was completed.

, Response.Redirect , Server.Transfer . , Server.Transfer url... . , Page1.aspx server.transfer page2.aspx. _ , 2.aspx. Page1.aspx Response.Redirect, page2.aspx.

, , Response.Redirect , , Server.Transfers , .

, http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=15   .

+12

Server.Transfer() , , .

Response.Redirect() - , URL-.

+2
Response.Redirect should be used :

  • -.
  • ,

  • , URL,

  • Response.Redirect , , .

    Server.Transfer :


  • .aspx-
    , www.yahoo.com . www.microsoft.com
  • URL-, -
0

Server.Transfer .

-2

Source: https://habr.com/ru/post/1738462/


All Articles