Control view status of Asp.net

Source: Internet
Author: User
The control view status is also a database, and the super-small key-Value Pair database.
The gridview control that directly deals with the database does not need to open the view status, because the modification is directly executed in the database and then reflected in the gridview control.
Sqldatasource, a data source control that directly deals with databases, does not need to enable the view status.

The client sends a request-> the server determines it is the first request or sending a response-> if sending a request, retrieve the value stored in the view State-> when the program is running, the user changes the control value, saved in view status.

Place the value of the listbox1 control to the listbox2 control, and then delete the value selected by listbox1. This requires the view status.

 

When the page is loaded for the first time, the value of listbox1 is initialized. Select a value and press the Add button to send the webpage back. The value of listbox1 decreases from the view state, and the value of listbox2 increases from the view State. The user selects a value again, the user presses the Add button for the second time, and the webpage returns again. The value of listbox1 decreases from the view state, and the value of listbox2 increases from the view State.

 

The view status of the listbox1 and listbox2 controls is canceled. The page is loaded for the first time, and the value of listbox1 is initialized. Select a value. Press the Add button to send the webpage back. The value of listbox1 is reduced, and the value of listbox2 is increased. The user selects a value again, the user presses the Add button for the second time, and the webpage returns again. The value of listbox1 is not reduced, and the value of listbox2 is not increased. Instead, it is replaced with the selected value.

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.