A detailed explanation of the difference between Response.Redirect and Server.Transfer

Source: Internet
Author: User
Redirect|response|server| Difference | Detailed explanation generally uses Response.Redirect this statement to carry on the address to turn, ASP3.0 later provides a new method to us, this method is more efficient. Let's take a look at how Response.Redirect and Server.Transfer respectively run!

The Response.Redirect actually sends an instruction (including a new address) to the browser when the server encounters the statement, and then lets the browser send the HTTP request, requesting the new HTTP address after the Response.Redirect, as follows:

Browser ASP file request-> Server execution-> encounter Response.Redirect statement-> server send Response.Redirect address to client side of browser-> The browser requests a new address (the address behind the Response.Redirect returned by the server) this is the whole process of a small response.redirect, do not see do not know, a look scared! It has so many processes, it's really scary ... and the Server.Transfer statement in ASP3.0 is directed to the following address after receiving the address, the process is as follows:

Browser ASP file request-> Server execution-> encountered Server.Transfer statement-> server to new file.

Another notable advantage of the Server.Transfer approach compared to the redirect method is that the contents of the request collection are not lost when the page is converted, which gives us a lot of convenience in programming (I don't give the specific example, ^_^).

In general, use the Server.Transfer method whenever possible (if the server is IIS), the Server.Transfer method is faster, and because it is only performed on the server, it can be compatible with any browser.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.