Common cross-page value transfer methods

Source: Internet
Author: User

1. querystring

Request. querystring ["paraname"] // pass the "paraname" Value

2. Pass the form-Post Control Value

3. Sending cookies

Set a single-value cookie

1). httpcookie ck_animal = new httpcookie ("animal ");

2). ck_animal.value = "cat ";

3). ck_animal.expires = datetime. Now. addday (1 );

4). response. Cookies. Add (ck_animal );

Read Single-value Cookie Information

You need to add a judgment to determine whether the cookie exists. Read data only when it exists.

Judgment:

If (request. Cookies ["animal"]! = NULL)

{

_ Mystr = request. Cookies ["animal"]. value;

}

Delete Single-value Cookie Information

How to delete a cookie:

Set the validity period expire of cookiename to an expiration date and write it to the client hard disk again.

Standard writing:

Response. Cookie ["animal"]. expires = datetime. minvalue;

 

4. Application Transfer

5. Session Transmission

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.