SessionPageStatePersister Constructor (Page)

 

Initializes a new instance of the SessionPageStatePersister class.

Namespace:   System.Web.UI
Assembly:  System.Web (in System.Web.dll)

Public Sub New (
	page As Page
)

Parameters

page
Type: System.Web.UI.Page

The Page that the view state persistence mechanism is created for.

Exception Condition
ArgumentException

The HttpSessionState is null (Nothing in Visual Basic)

The following code example demonstrates how you can write a PageAdapter class to return an instance of the SessionPageStatePersister class to save view state to the server-side session object.

Imports System.Web.UI

Namespace Samples.AspNet.VB

    Public Class MyPageAdapter
       Inherits System.Web.UI.Adapters.PageAdapter


       Public Overrides Function GetStatePersister() As PageStatePersister
          Return New SessionPageStatePersister(Page)
       End Function 'GetStatePersister

    End Class 'MyPageAdapter

End Namespace

.NET Framework
Available since 2.0
Return to top
Show: