SessionStateUtility.RaiseSessionEnd メソッド
アセンブリ: System.Web (system.web.dll 内)

Public Shared Sub RaiseSessionEnd ( _ session As IHttpSessionState, _ eventSource As Object, _ eventArgs As EventArgs _ )
Dim session As IHttpSessionState Dim eventSource As Object Dim eventArgs As EventArgs SessionStateUtility.RaiseSessionEnd(session, eventSource, eventArgs)
public static void RaiseSessionEnd ( IHttpSessionState session, Object eventSource, EventArgs eventArgs )
public: static void RaiseSessionEnd ( IHttpSessionState^ session, Object^ eventSource, EventArgs^ eventArgs )
public static void RaiseSessionEnd ( IHttpSessionState session, Object eventSource, EventArgs eventArgs )
public static function RaiseSessionEnd ( session : IHttpSessionState, eventSource : Object, eventArgs : EventArgs )

セッション状態モジュールは RaiseSessionEnd メソッドを使用して、ASP.NET アプリケーションの Global.asax ファイルに定義されている Session_OnEnd イベントを実行します。セッションが破棄されるか、または有効期限が切れると、セッション状態モジュールは RaiseSessionEnd メソッドを呼び出します。

カスタムのセッション状態モジュールの ReleaseRequestState イベントのハンドラのコード例を次に示します。セッションが破棄されると、このモジュールは RaiseSessionEnd メソッドを使用してアプリケーションの Global.asax ファイルに定義されている Session_OnEnd イベントを実行します。このコード例は、SessionStateUtility クラスのトピックで取り上げているコード例の一部分です。
' ' Event handler for HttpApplication.ReleaseRequestState ' Private Sub OnReleaseRequestState(source As Object, args As EventArgs) Dim app As HttpApplication = CType(source, HttpApplication) Dim context As HttpContext = app.Context ' Read the session state from the context Dim stateProvider As HttpSessionStateContainer = _ CType(SessionStateUtility.GetHttpSessionStateFromContext(context), HttpSessionStateContainer) ' If Session.Abandon() was called, remove the session data from the local Hashtable ' and execute the Session_OnEnd event from the Global.asax file. If stateProvider.IsAbandoned Then Try pHashtableLock.AcquireWriterLock(Int32.MaxValue) pSessionItems.Remove(pSessionID) Finally pHashtableLock.ReleaseWriterLock() End Try SessionStateUtility.RaiseSessionEnd(stateProvider, Me, EventArgs.Empty) End If SessionStateUtility.RemoveHttpSessionStateFromContext(context) End Sub
// // Event handler for HttpApplication.ReleaseRequestState // private void OnReleaseRequestState(object source, EventArgs args) { HttpApplication app = (HttpApplication)source; HttpContext context = app.Context; // Read the session state from the context HttpSessionStateContainer stateProvider = (HttpSessionStateContainer)(SessionStateUtility.GetHttpSessionStateFromContext(context)); // If Session.Abandon() was called, remove the session data from the local Hashtable // and execute the Session_OnEnd event from the Global.asax file. if (stateProvider.IsAbandoned) { try { pHashtableLock.AcquireWriterLock(Int32.MaxValue); pSessionItems.Remove(pSessionID); } finally { pHashtableLock.ReleaseWriterLock(); } SessionStateUtility.RaiseSessionEnd(stateProvider, this, EventArgs.Empty); } SessionStateUtility.RemoveHttpSessionStateFromContext(context); }

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からSessionStateUtility.RaiseSessionEnd メソッドを検索する場合は、下記のリンクをクリックしてください。

- SessionStateUtility.RaiseSessionEnd メソッドのページへのリンク