2017-11-29 3 views
0

これら2つのイベントハンドラはどのクラスのどのイベントに属していますか?インスタンスApplication_BeginRequestについてはSession_Start&Session_End in Global.asax.cs

にGlobal.asaxのは、命名規則によって、のHttpApplicationクラスのBeginRequestイベントに登録されています。 のHttpApplicationのHttpContextHttpSessionState

+0

は、なぜ彼らはクラスに属しなければならないでしょう。そして、that interfaceのドキュメントを見て、あなたはIHttpModuleを実装ビルトインタイプを見つけることができますか?彼らはとにかくASP.NETランタイムによって呼び出される魔法のメソッドです。 – CodeCaster

+0

何とかクラスのイベントに登録する必要があります。 –

+0

@CodeCaster - 彼らは魔法ではありません。あなた(または私)が実行時に同じように扱われるモジュールを登録できる特定のメカニズムがあります。 –

答えて

4

彼らはSessionStateModuleに属し:

私はそれらの2セッションイベントに関するこれらの3つのクラスで何かを見つけることができませんでした。

これは古いドキュメントですが、Using Modules with the Global.asax Fileで始めると、登録できるイベントはIHttpModuleインターフェイスを実装するタイプで公開されていることがわかります。

Class       Description 
DefaultAuthenticationModule Insures that an Authentication object is present in the context. This class cannot be inherited. 
FileAuthorizationModule  Verifies that the remote user has NT permissions to access the file requested. This class cannot be inherited. 
FormsAuthenticationModule  Enables ASP.NET applications to use forms authentication. This class cannot be inherited. 
PassportAuthenticationModul Provides a wrapper around PassportAuthentication services. This class cannot be inherited. 
SessionStateModule   Provides session-state services for an application. 
UrlAuthorizationModule  Provides URL-based authorization services for allowing or denying access to specified resources. This class cannot be inherited. 
WindowsAuthenticationModule Enables ASP.NET applications to use Windows/IIS authentication. This class cannot be inherited. 
関連する問題