SessionPageStatePersister(Page) Constructor
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes a new instance of the SessionPageStatePersister class.
public:
SessionPageStatePersister(System::Web::UI::Page ^ page);
public SessionPageStatePersister (System.Web.UI.Page page);
new System.Web.UI.SessionPageStatePersister : System.Web.UI.Page -> System.Web.UI.SessionPageStatePersister
Public Sub New (page As Page)
Parameters
Exceptions
The HttpSessionState is null (Nothing
in Visual Basic)
Examples
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.
namespace Samples.AspNet.CS {
using System.Web.UI;
public class MyPageAdapter : System.Web.UI.Adapters.PageAdapter {
public override PageStatePersister GetStatePersister() {
return new SessionPageStatePersister(Page);
}
}
}
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
End Namespace
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET