Prev | Current Page 661 | Next

Rob Cameron and Dale Michalk

"Pro ASP.NET 3.5 Server Controls and AJAX Components"


One difference with server controls of type MobileControl is PrivateViewState. Mobile
controls have an additional state-management mechanism in PrivateViewState that cannot
be disabled as ViewState can be by setting EnableViewState to a value of false. To use
PrivateViewState, a control overrides the LoadPrivateViewState and SavePrivateViewState
methods.
PrivateViewState is stored in the page sent to the client, so state placed in
PrivateViewState should be kept to a minimum due to both limited bandwidth and device
capabilities. The main function of PrivateViewState is to make state information available
across multiple pages. Here are some reasons why you would want to use PrivateViewState:
??? To store the currently active form on a page
??? To store pagination information about a form
??? To store device-specific decisions made by a control??™s adapter
The device adapter object is closely tied to its associated mobile control instance, storing
ViewState specific to the device adapter in addition to the mobile control??™s ViewState. All device
adapters inherit from the IControlAdapter interface, which includes the following methods:
??? LoadAdapterState
??? SaveAdapterState
LoadAdapterState is called by the mobile control??™s LoadPrivateViewState method during
the control??™s life cycle.


Pages:
649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673