Asp. NET page redirection

Source: Internet
Author: User

After Response.Redirect ("a.aspx") saves the data for this page, the server shifts the page directly to a flaw in a.aspx, which loses all of the request parameters for this page, and this method requires the client to initiate a request. This paper gives the solution and the difference of this problem.

First Response.Redirect ("A.aspx"), after saving the data on this page, the server will direct the page to the a.aspx. There is a flaw in this approach, which is to lose all of the request parameters for this page after turning, and this method requires the client to initiate a request.

A new function Server.Transfer ("a.aspx") was introduced in IIS 5.0, which solves the problem of losing this page request parameter after turning. And since it initiates a request from the server side directly to the next page, there is no need for the client to send the request again. The difference between this and Response.Redirect is that Response.Redirect can turn to any page, and Server.Transfer can only move to a page in the same directory or subdirectory, and the address becomes the page address when the Response.Redirect is turned, and SE RVer. The original address is unchanged when the transfer is turned, and the parameter values passed are also hidden.

Another method is Server.Execute (a.aspx), which is similar to the Server.Transfer function. The main difference is that Server.Execute will return to the original page to continue processing after the a.aspx execution is completed.

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.