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.