Share via


Supporting Application View State

For ASP.NET mobile controls, an application view state performs the same way it does for ASP.NET server controls in the Microsoft .NET Framework. Use the following guidelines when supporting application view state in your code:

  • All controls have a property called ViewState that automatically manages state information. Any basic user properties that you can save as part of a view state can be saved in this property.
  • After a page is initialized from persistent settings, view-state tracking begins. Write any changes that are made after this point as part of a view state. The ViewState property automatically manages these changes.
  • For a more complex view state behavior, you must write your controls to override the TrackViewState, LoadViewState, and SaveViewState methods, and you must provide the appropriate logic.
  • Complex objects that can handle their own view state management, such as items in a list, can implement the IStateManager interface, an interface that exposes the members mentioned previously.

See Also

Supporting View State