Three methods for page redirection when ASP. NET is used

Source: Internet
Author: User

Use ASP. NET to redirect pages.

First, response. Redirect ("A. aspx"). After saving the data on this page, the server directly redirects the page to A. aspx. This method has a defect, that is, all the Request Parameters on this page will be lost after turning, and this method requires the client to initiate a request.

A new function server. Transfer ("A. aspx") is introduced in IIS 5.0, which solves the problem of losing the request parameter of this page after turning. Because it initiates a request directly from the server to the next page, the client does not need to send the request again. It corresponds to response. the difference between redirect is: response. redirect can be switched to any page, while server. transfer can only switch to a webpage in the same directory or subdirectory; response. when redirect is switched, The address will change to the page address after the jump, while the server. the original address remains unchanged when the transfer is switched, and the passed parameter value is also hidden.

Another method is server. Execute (A. aspx), which is similar to server. Transfer. The main difference is that after server.exe cute is switched to a. aspx, the original page will be returned for further processing.

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.