- Home
- About
- Testimonials
- Demos
- Download
- Documentation
- Blogs
- Forum
- Support

Packages:
default
System
System.Caching
System.Collections
System.Data
System.Data.ActiveRecord
System.Data.ActiveRecord.Relations
System.Data.ActiveRecord.Scaffold
System.Data.ActiveReecord.Scaffold.InputBuilder
System.Data.Commom.Sqlite
System.Data.Common
System.Data.Common.Mssql
System.Data.Common.Mysql
System.Data.Common.Oracle
System.Data.Common.Pgsql
System.Data.Common.Sqlite
System.Data.DataGateway
System.Data.SqlMap
System.Data.SqlMap.Configuration
System.Data.SqlMap.Statements
System.Exceptions
System.I18N
System.IO
System.Security
System.Util
System.Web
System.Web.Services
System.Web.UI
System.Web.UI.ActiveControls
System.Web.UI.WebControls
System.Web.UI.WebControls.assets
System.Xml
Classes:
IBroadcastEventReceiver
IButtonControl
INamingContainer
IPageStatePersister
IPostBackDataHandler
IPostBackEventHandler
ISurroundable
ITemplate
ITheme
IValidatable
IValidator
TBroadcastEventParameter
TCachePageStatePersister
TClientScriptManager
TClientSideOptions
TCommandEventParameter
TCompositeControl
TCompositeLiteral
TControl
TControlAdapter
TControlCollection
TEmptyControlCollection
TForm
THead
THtmlWriter
TPage
TPageStateFormatter
TPageStatePersister
TSessionPageStatePersister
TTemplate
TTemplateControl
TTemplateManager
TTextProcessor
TTheme
TThemeManager

Keyword

# Class TSessionPageStatePersister

    TComponent
       |
       --TSessionPageStatePersister

TSessionPageStatePersister class

TSessionPageStatePersister implements a page state persistent method based on sessions. Page state are stored in user sessions and therefore, this persister requires session to be started and available.

TSessionPageStatePersister keeps limited number of history states in session, mainly to preserve the precious server storage. The number is specified by HistorySize, which defaults to 10.

There are a couple of ways to use TSessionPageStatePersister. One can override the page's TPage::getStatePersister() method and create a TSessionPageStatePersister instance there. Or one can configure the pages to use TSessionPageStatePersister in page configurations as follows,

       <pages StatePersisterClass="System.Web.UI.TSessionPageStatePersister" />

The above configuration will affect the pages under the directory containing this configuration and all its subdirectories. To configure individual pages to use TSessionPageStatePersister, use

       <pages>
         <page id="PageID" StatePersisterClass="System.Web.UI.TSessionPageStatePersister" />
       </pages>

Since: 3.1
Author: Qiang Xue <qiang.xue@gmail.com>

Method Summary
integer | getHistorySize ()
void | getPage ( TPage 0)
mixed | load () Loads page state from session.
void | save ( mixed $state) Saves state in session.
void | setHistorySize ( integer $value)
void | setPage ( TPage $page)

Methods Inherited From TComponent

TComponent::addParsedObject(), TComponent::attachEventHandler(), TComponent::canGetProperty(), TComponent::canSetProperty(), TComponent::createdOnTemplate(), TComponent::detachEventHandler(), TComponent::evaluateExpression(), TComponent::evaluateStatements(), TComponent::getEventHandlers(), TComponent::getSubProperty(), TComponent::hasEvent(), TComponent::hasEventHandler(), TComponent::hasProperty(), TComponent::raiseEvent(), TComponent::setSubProperty(), TComponent::__get(), TComponent::__set()

Constant Summary
string | QUEUE_SESSION_KEY |
string | STATE_SESSION_KEY |

Method Details

## getHistorySize

public integer getHistorySize | ()

Output
integer | maximum number of page states that should be kept in session. Defaults to 10.
Exception

## getPage

public void getPage | (TPage 0 )

Input
TPage | 0 | the page that this persister works for
Output
Exception

## load

public mixed load | ()

Loads page state from session.

Output
mixed | the restored state
Exception
throws | THttpException if page state is corrupted

## save

public void save | (mixed $state )

Saves state in session.

Input
mixed | $state | state to be stored
Output
Exception

## setHistorySize

public void setHistorySize | (integer $value )

Input
integer | $value | maximum number of page states that should be kept in session
Output
Exception
throws | TInvalidDataValueException if the number is smaller than 1.

## setPage

public void setPage | (TPage $page )

Input
TPage | $page | the page that this persister works for.
Output
Exception

Constant Details

### QUEUE_SESSION_KEY

#### Type:

string

#### Value:

'PRADO_SESSION_STATEQUEUE'

### STATE_SESSION_KEY

#### Type:

string

#### Value:

'PRADO_SESSION_PAGESTATE'