C # Asp.net page value passing method summary

Source: Internet
Author: User

1. <a href = "target. aspx? Param1 = ** & param2 = ** "> link transfer </a>

Receiving page: String STR = request ["param1"]

 

2. Session sharing

Sending page: Session ("param1") = "**";

String STR = SESSION ("param1"). tostring ();

 

3. Application Sharing

Sending page: Application ("param1") = "**";

By page: String STR = Application ("param1"). tostring ();

This method is not often used because the application is in an applicationProgramDomain range sharing. All users can change and set their values, so they only apply counters and other places that require global variables.

 

4. Cookie

 

5. response. Redirect () method

Response. Redirect ("target. aspx? Param1 = ** & param2 = **")

Receiving page: String STR = request ["param1"]

 

6. server. Transfer () mode.

Server. Transfer ("target. aspx? Param1 = ** & param2 = **")

Receiving page: String STR = request ["param1"]

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.