惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google Online Security Blog
Google Online Security Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
C
CERT Recently Published Vulnerability Notes
C
Cybersecurity and Infrastructure Security Agency CISA
Cisco Talos Blog
Cisco Talos Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
Scott Helme
Scott Helme
Project Zero
Project Zero
E
Exploit-DB.com RSS Feed
S
Secure Thoughts
K
Kaspersky official blog
L
Lohrmann on Cybersecurity
NISL@THU
NISL@THU
WordPress大学
WordPress大学
N
News and Events Feed by Topic
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
L
LINUX DO - 热门话题
小众软件
小众软件
P
Privacy & Cybersecurity Law Blog
博客园 - 聂微东
Google DeepMind News
Google DeepMind News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
A
About on SuperTechFans
Hacker News: Ask HN
Hacker News: Ask HN
AWS News Blog
AWS News Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
H
Hacker News: Front Page
F
Full Disclosure
Latest news
Latest news
Schneier on Security
Schneier on Security
The Hacker News
The Hacker News
T
Troy Hunt's Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Jina AI
Jina AI
Martin Fowler
Martin Fowler
P
Proofpoint News Feed
TaoSecurity Blog
TaoSecurity Blog
G
GRAHAM CLULEY
Forbes - Security
Forbes - Security
V
V2EX - 技术
酷 壳 – CoolShell
酷 壳 – CoolShell
V
Vulnerabilities – Threatpost
C
Cyber Attacks, Cyber Crime and Cyber Security
MongoDB | Blog
MongoDB | Blog
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
Hugging Face - Blog
Hugging Face - Blog
P
Privacy International News Feed
C
Check Point Blog
N
News and Events Feed by Topic

博客园 - winkingzhang

Build 2016概览 WinRT开发系列之编程语言:功能和效率 WinRT开发系列之基础概念:WinRT不是…… VS2010 Extension实践(3)——实现自定义配置 [VS2010 Extension]PowerExtension.GoToDefinition VS2010 Extension实践(2) VS2010 Extension实践 如何通过反射调用带有ref或者out的参数的方法[迁移] Win7硬盘安装和移动硬盘访问出错的修复办法[迁移] zt. Windows Mobile开发文章收藏 [WPF]在Style中设置ToolTip的问题分析 [WPF]RadioButton在Group的Header区部分不响应鼠标选择的bug分析 WPF模式思考 (zt) How to Get IIS Web Sites Information Programmatically Visual Studio 调试器 Application Request Routing and the IIS 7.0 Web Management Service Reference Resources for MOSS and WSS FileSystemWatcher事件多次触发的解决方法 CAS and Native Code
ASP.NET Application Life Cycle
winkingzhang · 2008-05-28 · via 博客园 - winkingzhang

Original Post at http://blogs.msdn.com/tom/archive/2008/05/27/asp-net-application-life-cycle.aspx

ASP.NET Application Life Cycle

Have you ever wondered about all the stages that an ASP.NET request goes through?  Ever wonder why it is such a performance hit to have a wildcard mapping to map all extensions on your web server to ASP.NET?  This information corresponds to IIS 5.0 and 6.0.  For information on the life cycle in IIS 7.0, see ASP.NET Application Life Cycle Overview for IIS 7.0.  You can also check out the ASP.NET Page Life Cycle Overview for information on what happens once a page is run.

User requests a resource

A request comes into the web server and it will check to see what is mapped to handle the request.  ASP.NET is an ISAPI extension under the web server.

ASP.NET receives the first request for an application

ASP.NET will first create the application domain for this application.  These allow each application to be isolated from each other.  ASP.NET then compiles all the top-level items in the application, if required, including the App_Code folder.

ASP.NET core objects created for the request

ASP.NET will create the Request, Response, and Context objects for the request.  This includes browser information, cookies, headers and everything that the server will respond back to the client with.

HttpApplication is assigned to the request

The application is started by creating the HttpApplication object, taking into account the Global.asax file if it exists.  At this stage, ASP.NET will create any configured modules, such as SessionStateModule to handle Session.

HttpApplication pipeline

The following events occur:

  1. Validate the request – checking for malicious markup
  2. Perform URL mapping
  3. BeginRequest event
  4. AuthenticateRequest event
  5. PostAuthenticateRequest event
  6. AuthorizeRequest event
  7. PostAuthorizeRequest event
  8. ResolveRequestCache event
  9. PostResolveRequestCache event
  10. Find the requested resource, if it is a Page, compile the page
  11. PostMapRequestHandler event
  12. AcquireRequestState event
  13. PostAcquireRequestState event
  14. PreRequestHandlerExecute event
  15. Call ProcessRequest on the HttpHandler
  16. PostRequestHandlerExecute event
  17. ReleaseRequestState event
  18. PostReleaseRequestState event
  19. Response filtering
  20. UpdateRequestCache event
  21. PostUpdateRequestCache event
  22. EndRequest event
  23. PreSendRequestHeaders event
  24. PreSendRequestContent event

Hopefully this will give you a little perspective on all of the different times that you can hook into a request and the different things you can act on.  There are additional things you can do, such as Application_Start events in the global.asax file.  For those and some nice pictures of some of the above data, take a look at the MSDN page here.