Several Methods for passing values between ASP. NET pages

Source: Internet
Author: User

Button#click (= +Page_Load (= Request. QueryString [

Presumably, this is definitely the most common usage. Its operations are similar to those of the Application, which act on individual users. Therefore, excessive storage will result in the depletion of server memory resources.

Button#click (] =Page_Load (= Session [

This is also a common method. Cookies are used to store small pieces of information in a user's browser and store user-related information, such as the user ID and user preferences when a user accesses a website, the user can retrieve the previous information from the next visit. Therefore, cookies can also pass values between pages. The Cookie is sent back and forth between the browser and the server through the HTTP header. A Cookie can only contain string values. If you want to store an integer value in a Cookie, you must first convert it to a string.

,(1) a. aspx

Button#click (= HttpCookie (,= Request. Cookies []. Value;

Button#click (] =Page_Load (= Application [

This can be said to be the method used for face object development. It uses Server. the Transfer method directs the process from the current page to another page. The new page uses the response stream of the previous page. Therefore, this method is completely object-like and concise and effective.

{Button#click (Page_Load (newWeb =

Related Article

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.