. The principle of viewstate in net

Source: Internet
Author: User

Today in the company unexpectedly someone asked me viewstate principle. Actually, the most basic thing about this thing. May be said on the internet a little general. I will now share my personal understanding:

First, after the browser has sent the request to the server side, the server will accept the request to see the viewstate sent by the client (whether it is created by a custom or service control).

He will automatically create a __viewstate (this you don't have to worry about __viewstate) what the hell. Can be used when he is a temporary stored variable (in the. NET may be called a hidden field).

This stuff is, of course, after BASE64 encryption is returned to the browser side (this encryption process is done in the Saveallstate method in the SaveState event of the page life cycle. )

When the browser submits the form, the __viewstate hidden field is also submitted to the server at this time ReadState event of the page life cycle
The Readallstate method decrypts the encrypted value back to Base64 and finally assigns the value to the viewstate named name.

Finally, to manipulate the values in ViewState


  

. The principle of viewstate in net

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.