Use server. Transfer

Source: Internet
Author: User

Through server. the transfer method transfers the execution flow from the current aspx file to another ASPX page on the same server, while retaining form data or querying strings, set the second parameter of this method to true, and use server on the first page. transfer ("target Page name. Aspx ", true); used to retrieve data from the target page: ruquest. Form [" Control name "] Or ruquest. querystring [" Control name "]. ASP. net2.0 can also be used in this way,CodeAs follows:

Previouspage PG1;

PG1 = (previouspage) Context. Handler;

Response. Write (pg1.name );

Note: This code is used to retrieve the passed value from the target page. Previous-page is the class name of the original page, and name is the attribute defined on the original page, the data to be transferred is stored in this attribute.

To use this method, you need to write some code to create some attributes so that you can access it on another page. You can access the value on another page in the form of object attributes, this method is particularly useful in inter-page value transfer. This method is not only concise, but also object-oriented.

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.