Application, session, iewstate, and repeater commang usage, iewstatecommang

Source: Internet
Author: User

Application, session, iewstate, and repeater commang usage, iewstatecommang

Session: Transfers values between different browsers. For websites like banks, the user name and password are stored in the session for security purposes.
Each computer accesses the server. Each session has the same key value, but the content is different.

All the above content is the same as cookies.

Different:
1. The Session is saved on the server.
2. The Session is not persistent, and its storage period is 20 minutes.

Important: Do not abuse or use sessions. Abuse of sessions may cause server content overflow and waste of resources. Sessions use server memory, because the data extraction and interaction in the memory are the fastest, and proper use can improve the browsing speed.

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

 


Application:
Global Object
Application ["key"] indicates that all users obtain the same value for this key.
If there is no storage period, it will be saved all the time. For example, a version number or a similar version number may exist.

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


ViewState: (for more information)
Understanding as a Case

Similar to the intermediate process, because the webpage is not fixed, clicking the button will refresh the page, and the control will save the value with iewstate, saving the value before refreshing as a special code. Refresh and then assign the value to the control

 


Repeater Command operation:
1. ItemCommand event-all controls that can trigger events in Repeater will trigger this event.

2. CommandName: determines what button is clicked. e. CommandName

3. CommandArgument: The primary key value data passed by the trigger event.
Single quotation marks are required for binding interface values!

Commandname classifies buttons

Commandargument transfers the selected data and values

 

4. ItemCreated: execute this event once the HTML code is generated in the ItemCreated item template.
5. ItemDataBound-the item template binds the data and executes the event once.

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.