System.Web.UI.Page.SavePageStateToPersistenceMedium Method

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

Syntax

[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)]
protected virtual void SavePageStateToPersistenceMedium (object viewState)

Parameters

viewState
Documentation for this section has not yet been entered.

Remarks

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

ASP.NET includes two descendents of the System.Web.UI.PageStatePersister class, the System.Web.UI.HiddenFieldPageStatePersister class that saves state information in a hidden field included in the ASP.NET page, and the System.Web.UI.SessionPageStatePersister class that saves state in the Page.Session object associated with the request. Note that when using the System.Web.UI.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 System.Web.UI.PageStatePersister class that saves and loads state to the persistence medium of your choice. For an example of creating a new System.Web.UI.PageStatePersister object, see the System.Web.UI.PageStatePersister class.

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

Requirements

Namespace: System.Web.UI
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0