"2017-05-22" WebForm built-in objects: command usage for application and viewstate, repeater

Source: Internet
Author: User
Tags server memory

First, built-in objects

1, Application

Storage on server side, consuming server memory
Life cycle: Permanent

This is the object that everyone accesses.

Pass Value: The object type can be passed to the objects.

string S =textbox1.text;

application["AAA"]=S;

Value:

if (application["AAA"]!=null)

{

label1.text=application["AAA"].tostring ();

}

2, ViewState

ViewState is the clas= "Aspnethidden" div in the HTML code generated after ASP, with many hidden fields.

These are called ViewState.

Ii. command usage of repeater

The command usage of repeater is the native event usage of the Repeater control

Repeater inside if the loop control, the ID of the control will be changed
This event is triggered by Repeater's ItemCommand event to give each control of the loop a delegate event-any control that executes the commit

If you loop a control that is two different functions, group the controls by using the CommandName property
Attribute-commandname= "" In order to group the button events, fill in the quotation marks. Two different controls fill in different content.

Property-commandargument= "PRIMARY key value" uses this property to fetch the primary key value to manipulate the data.


Two other events of repeater:

ItemCreated-After the row is created, bind the data before

ItemDataBound-After binding the data, execute it again

"2017-05-22" WebForm built-in objects: command usage for application and viewstate, repeater

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.