Redigera

Dela via


PageAdapter.GetStatePersister Method

Definition

Returns an object that is used by the Web page to maintain the control and view states.

public:
 virtual System::Web::UI::PageStatePersister ^ GetStatePersister();
public virtual System.Web.UI.PageStatePersister GetStatePersister ();
abstract member GetStatePersister : unit -> System.Web.UI.PageStatePersister
override this.GetStatePersister : unit -> System.Web.UI.PageStatePersister
Public Overridable Function GetStatePersister () As PageStatePersister

Returns

An object derived from PageStatePersister that supports creating and extracting the combined control and view states for the Page.

Remarks

The PageStatePersister property uses the GetStatePersister method to return the object, derived from the PageStatePersister class, that forms and extracts the combined control and view states for the page. If there is no derived page adapter attached to the page, a HiddenFieldPageStatePersister object is used to maintain the state in a hidden field on the page.

Link type Resulting link
Code Entity Reference,cer ToString
Code Entity Reference Qualified, cerq Char.ToString
Code Entity Reference Specific,cers ToString(Char)
Code Entity Reference Qualified Specific, cerqs Char.ToString(Char)

Notes to Inheritors

When you inherit from the PageAdapter class, you can override the GetStatePersister() method to return another derived page state persister if it is not feasible to maintain the combined state in a hidden field (for example, because of limited resources).

The GetStatePersister() base class returns a HiddenFieldPageStatePersister object. You can use the SessionPageStatePersister class to maintain the page state in session state.

Applies to

See also