Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
Page Class
Page Methods
 SavePageStateToPersistenceMedium Me...

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
Page..::.SavePageStateToPersistenceMedium Method

Saves any view-state and control-state information for the page.

Namespace:  System.Web.UI
Assembly:  System.Web (in System.Web.dll)
Visual Basic (Declaration)
Protected Friend Overridable Sub SavePageStateToPersistenceMedium ( _
    state As Object _
)
Visual Basic (Usage)
Dim state As Object

Me.SavePageStateToPersistenceMedium(state)
C#
protected internal virtual void SavePageStateToPersistenceMedium(
    Object state
)
Visual C++
protected public:
virtual void SavePageStateToPersistenceMedium(
    Object^ state
)
JScript
protected internal function SavePageStateToPersistenceMedium(
    state : Object
)

Parameters

state
Type: System..::.Object

The SavePageStateToPersistenceMedium method uses the Save method of the System.Web.UI..::.PageStatePersister object referenced by the PageStatePersister property to store view-state and control-state information for the page.

ASP.NET includes two descendents of the PageStatePersister class, the HiddenFieldPageStatePersister class that saves state information in a hidden field included in the ASP.NET page, and the SessionPageStatePersister class that saves state in the Session object associated with the request. Note that when using the SessionPageStatePersister class the hidden VIEWSTATE field is still rendered as this is used to determine post back.

To save state in the location of your choice, you should create a new descendent of the PageStatePersister class that saves and loads state to the persistence medium of your choice. For an example of creating a new PageStatePersister object, see the PageStatePersister class.

If you are using the .NET Framework version 1.0 or 1.1, override this method if you want to save the Page state in anything other than a hidden field. If you choose to do so, you must also override the LoadPageStateFromPersistenceMedium method.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker