Server.Transfer Vs. Response.Redirect

前端 未结 16 2501
夕颜
夕颜 2020-11-22 14:38

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

  • What are advantages and disadvantages of each?
  • When is one
16条回答
  •  野性不改
    2020-11-22 15:40

    There are many differences as specified above. Apart from above all, there is one more difference. Response.Redirect() can be used to redirect user to any page which is not part of the application but Server.Transfer() can only be used to redirect user within the application.

    //This will work.
    Response.Redirect("http://www.google.com");
    
    //This will not work.
    Server.Transfer("http://www.google.com");
    

提交回复
热议问题