Webform built-in object Session object, Application global object, ViewState, webformviewstate

Source: Internet
Author: User

Webform built-in object Session object, Application global object, ViewState, webformviewstate

Session

Each computer accesses the server with an independent session with the same key value and different content.

1. The session is saved on the server.

2. The session is not persistent and the storage period is 20 minutes.

 

Important: Do not abuse sessions. Abuse will cause Server Overflow and waste of resources.

Value assignment: Session ["key"] = value;
Value: string a = Session ["key"];
Clear: Session ["key"] = null;

 

Application

Application ["key"] indicates that all users obtain the same value in this key. It is saved without a storage period and is usually used as the version number.

Value assignment: Application ["key"] = value;
Value: Application. Get ("key ");

 

Repeater Command operation:

 

 

Example:

<ItemTemplate> <tr class = "tr_Item">

 

 

 

Background code:

If (e. commandName = "delete") // delete button {new UserDA (). delete (e. commandArgument. toString (); Repeater1.DataSource = new UserDA (). select (); Repeater1.DataBind ();} if (e. commandName = "xiugai") {new UserDA (). select (e. commandArgument. toString (); Repeater1.DataSource = new UserDA (). select (); Repeater1.DataBind ();}

 

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.