Nice programing

HTTPModule 이벤트 실행 순서?

nicepro 2020. 12. 7. 20:39
반응형

HTTPModule 이벤트 실행 순서?


누구든지 사이트 또는 페이지를 알고 있거나 HTTPModule 이벤트 실행을위한 HTTPApplication 클래스의 이벤트 실행 순서를 알고 있습니까?

모든 이벤트에 대한 MSDN 설명서찾았 지만 프로세스 단계 목록이 표시되지 않고 하나도 찾을 수 없습니다.


아마도 이것이 도움이 될 것입니다

http://support.microsoft.com/kb/307985/en-us/

HttpApplication 클래스는 모듈이 동기화 할 수있는 여러 이벤트를 제공합니다. 각 요청에서 동기화 할 모듈에 대해 다음 이벤트를 사용할 수 있습니다. 이러한 이벤트는 순서대로 나열됩니다.

  1. BeginRequest
  2. AuthenticateRequest
  3. AuthorizeRequest
  4. ResolveRequestCache
  5. AcquireRequestState
  6. PreRequestHandlerExecute
  7. PostRequestHandlerExecute
  8. ReleaseRequestState
  9. UpdateRequestCache
  10. EndRequest

각 요청 전송에 대해 동기화 할 모듈에 대해 다음 이벤트를 사용할 수 있습니다. 이러한 이벤트의 순서는 결정적이지 않습니다.

  • PreSendRequestHeaders
  • PreSendRequestContent
  • 오류

전체 정보는 기사를 참조하십시오.


MSDN Library 문서 :

다음은 ASP.NET 4.0에 대한 요청 파이프 라인의 이벤트 (굵게 표시됨) 및 기타 단계입니다.

  1. 브라우저에서 보낸 정보를 검사하고 잠재적으로 악의적 인 마크 업이 포함되어 있는지 확인하는 요청의 유효성을 검사합니다.
  2. Web.config 파일의 UrlMappingsSection 섹션에 URL이 구성된 경우 URL 매핑을 수행합니다.
  3. 인상 BeginRequest 이벤트를.
  4. 인상 대해 AuthenticateRequest 이벤트를.
  5. 인상 PostAuthenticateRequest의 이벤트를.
  6. 인상 은 AuthorizeRequest의 이벤트를.
  7. 인상 PostAuthorizeRequest의 이벤트를.
  8. 인상 ResolveRequestCache의 이벤트를.
  9. 인상 PostResolveRequestCache의 이벤트를.
  10. [IIS 5.0 / 6.0] 요청 된 리소스의 파일 이름 확장명 (응용 프로그램 구성 파일에 매핑 됨)에 따라 IHttpHandler를 구현하는 클래스를 선택하여 요청을 처리합니다. 요청이 Page 클래스에서 파생 된 개체 (페이지)에 대한 것이고 페이지를 컴파일해야하는 경우 ASP.NET은 페이지의 인스턴스를 만들기 전에 페이지를 컴파일합니다. [7.0 IIS] 인상 MapRequestHandler의 이벤트. 요청 된 리소스의 파일 이름 확장명에 따라 적절한 처리기가 선택됩니다. 핸들러는 IIS 7.0 StaticFileModule과 같은 네이티브 코드 모듈이거나 .aspx 파일을 처리하는 PageHandlerFactory 클래스와 같은 관리 코드 모듈 일 수 있습니다.
  11. 인상 PostMapRequestHandler의 이벤트를.
  12. 인상 AcquireRequestState의 이벤트를.
  13. 인상 PostAcquireRequestState의 이벤트를.
  14. 인상 PreRequestHandlerExecute의 이벤트를.
  15. 요청에 대해 적절한 IHttpHandler 클래스의 ProcessRequest 메서드 (또는 비동기 버전 IHttpAsyncHandler.BeginProcessRequest)를 호출합니다. 예를 들어 페이지에 대한 요청 인 경우 현재 페이지 인스턴스가 요청을 처리합니다.
  16. 인상 PostRequestHandlerExecute의 이벤트를.
  17. 인상 ReleaseRequestState의 이벤트를.
  18. 인상 PostReleaseRequestState의 이벤트를.
  19. Filter 속성이 정의 된 경우 응답 필터링을 수행합니다.
  20. 인상 UpdateRequestCache의 이벤트를.
  21. Raise the PostUpdateRequestCache event.
  22. [IIS 7.0] Raise the LogRequest event.
  23. [IIS 7.0] Raise the PostLogRequest event.
  24. Raise the EndRequest event.
  25. Raise the PreSendRequestHeaders event.
  26. Raise the PreSendRequestContent event.

Note: The MapRequestHandler, LogRequest, and PostLogRequest events are supported only if the application is running in Integrated mode in IIS 7.0 and with the .NET Framework 3.0 or later.


The accepted answer is out-of-date. Here is the list of events in the order they are raised according to the documentation:

  1. BeginRequest

  2. AuthenticateRequest

  3. PostAuthenticateRequest

  4. AuthorizeRequest

  5. PostAuthorizeRequest

  6. ResolveRequestCache

  7. PostResolveRequestCache

    After the PostResolveRequestCache event and before the PostMapRequestHandler event, an event handler (which is a page that corresponds to the request URL) is created. When a server is running IIS 7.0 in Integrated mode and at least the .NET Framework version 3.0, the MapRequestHandler event is raised. When a server is running IIS 7.0 in Classic mode or an earlier version of IIS, this event cannot be handled.

  8. PostMapRequestHandler

  9. AcquireRequestState

  10. PostAcquireRequestState

  11. PreRequestHandlerExecute

  12. PostRequestHandlerExecute

  13. ReleaseRequestState

  14. PostReleaseRequestState

  15. UpdateRequestCache

  16. PostUpdateRequestCache

  17. LogRequest

  18. PostLogRequest

  19. EndRequest

참고URL : https://stackoverflow.com/questions/441421/httpmodule-event-execution-order

반응형