|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.|
Page Adapters and View State
When saving view state, the page generates a string that represents the portion of view state that is sent to the client. This string is encoded. It includes private view state (if any), and an identifier for any application view state saved in the session. With ASP.NET mobile controls, the page adapter must persist this string to the client and ensure that it is available on a subsequent postback.
On rendering, the page adapter must access the string through the page'sproperty and write it to the client. On postback, the page adapter ensures that the persisted state is available in the form data by using the key defined by the static member of the object (a string constant that is defined as "__VIEWSTATE").
Typically, you can have a page adapter write this string as a hidden form field whose name is specified by the ViewStateID field. When the form is submitted for postback, the value is automatically available in the form data, and the page adapter does not need to do any additional postback processing.