Compartir a través de


IPersistHistory interface

Provides a mechanism for a component to persist its state in its containing application during the current session.

Members

The IPersistHistory interface inherits from IPersist. IPersistHistory also has these types of members:

  • Methods

Methods

The IPersistHistory interface has these methods.

Method Description
GetPositionCookie

Copies a saved vertical scroll position into the specified address.

LoadHistory

Restores the state of the component.

SaveHistory

Saves the state of a component.

SetPositionCookie

Saves a vertical scroll position.

 

Remarks

The IPersistHistory interface is implemented by a component to maintain its state across navigations in a browser. For example, a user enters data into a Web-based form containing intrinsic controls and a custom edit control. The user navigates away from the page, and then returns during the current browser session to find that the data entered into the custom component is lost, while the intrinsic controls have maintained their state.

When a user navigates away from a page, all controls on the page are queried for IPersistHistory. The controls that implement the interface are handed a stream through the SaveHistory method, in which they can store their current state. If the page is loaded again during the current browser session, each control is handed a stream through the LoadHistory method from which they can reload their previous state.

Windows Internet Explorer uses up to two MB of persistent data for all controls. When this limit is exceeded, the least recently used data is discarded. Component developers should respect the requirements of other controls and limit their use of the history cache.

This interface replaces the four-page cache implemented by Microsoft Internet Explorer 3.0.

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows 2000 Server

Header

Perhist.h

IDL

Perhist.idl

DLL

Shell32.dll