Application, session, Iewstate, and Commang usage of repeater

Source: Internet
Author: User

Session: Transfer values between different browsers, such as banks and other sites to secure the user name password stored in the session.
Each computer accesses the server, it will be a separate set of Session,key values are the same, but the content is not the same

All of the above is the same as cookies.

Not the same:
1, the session save location is saved on the server
2, the session does not have a lasting, its preservation period is 20 minutes

Focus: Do not abuse the session, do not use, misuse may cause server content overflow, do not cause waste of resources, the session uses the server's memory, because in-memory data extraction and interaction is the fastest, use properly can improve the browsing speed.

Assignment: session["key"] = value;
Value: String a = session["key"];
Clear: session["key"]=null;


Application:
Global objects
application["Key"] is all the user gets the value of this key is the same
There is no save cycle, it will always be saved, for example: The version number can exist in this kind of

Assignment value: application["key"]= value;
Value: Application.get ("key");


ViewState: (as an understanding)
Understanding as a case

Similar to the middle process, due to the Web page is not fixed, the click button will refresh, the control is assigned to the value of the Iewstate save, the value before the refresh to save a special code. Refresh and assign a value to the control


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

2, CommandName-Judge what button is clicked, E.commandname

3. CommandArgument-The primary key value data passed by the triggering event, put it in the face.
Bound with a single quotation mark!

CommandName to classify buttons

CommandArgument will select the data, pass the value

4. ItemCreated-the event will be executed once the HTML code is generated in the item template
5. ItemDataBound-Item template to execute this event once data is bound

Application, session, Iewstate, and Commang usage of repeater

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.