Differences between Asp.net response. Redirect and server. Transfer

Source: Internet
Author: User
The response. Redirect statement is usually used for address redirection. asp32.0 and later provides us with a new method, which is more efficient. Let's take a look at how response. Redirect and server. Transfer run!
Response. redirect actually sends a command (including a new address) to the browser when the server encounters this statement, and then asks the browser to send an HTTP request and request response. the new HTTP address next to redirect. The process is as follows:
Browser ASP file request-> server execution-> response. redirect statement-> the server sends response. the address after redirect is sent to the client browser-> the browser requests to execute the new address (the server returns the response. the address after redirect) This is a small response. the entire redirect process,
The server. Transfer statement in asp2.0 directly redirects to the following address after receiving the address. The process is as follows:
Browser ASP file request-> server execution-> server. Transfer statements-> server redirection to new files.
The server. transfer method has another significant advantage over the Redirect method. The content in the request set will not be lost during page conversion, which makes programming very convenient.
Generally, use the server. Transfer Method as much as possible (the premise is that the server is IIS). The server. Transfer Method is faster and can be compatible with any browser because it is only executed on the server.

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.