IStateFormatter Interface
Defines methods that a type implements to serialize and deserialize an object graph.
Assembly: System.Web (in System.Web.dll)
The IStateFormatter type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | Deserialize | Deserializes an object state graph from its serialized string form. |
![]() | Serialize | Serializes ASP.NET Web server control state to string form. |
The IStateFormatter interface defines methods that a type can implement to serialize and deserialize the state that an ASP.NET Web server control maintains in its ViewState property. This infrastructure is used by classes that derive from the PageStatePersister class to maintain an ASP.NET page's state between requests. By default, ASP.NET page state is serialized and deserialized by an instance of the ObjectStateFormatter class; however, site and adapter developers can implement the IStateFormatter interface on their own types to perform this work.
For more information about Web server control state management and view state, see ASP.NET State Management Overview and Dynamic Web Server Controls and View State.
The following code example demonstrates how to create a PageStatePersister object that saves view and control state to a stream on the Web server. The StreamPageStatePersister class demonstrates how to override the Load and Save methods to extract and save page state information. These methods use the IStateFormatter interface inherited from the PageStatePersister class to serialize and deserialize view state. This code example is part of a larger example provided for the PageStatePersister class.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
