ASP.NET - Application Life Cycle Principle

/*

Author: Jiangong SUN

*/


Today, I want to share the knowledge about IIS, Application Life Cycle, request handling and so on.


ASP.NET web sites are developed with Web Forms, MVC, Web Pages and hosted in Internet Information Server (IIS). 

When  there is a page request, for example: http://www.example.com/index.aspx, IIS will use its Internet Server Application Programming Interface(ISAPI)

IIS will decide that the request will be treated by aspx(active server pages), ashx(active server handlers), ascx(active server controls) or asmx(active server methods).

If you want to treat any custom type of files, you need to create a custom handler and register it to IIS. 


The request handling process are Request -> IIS -> ISAPI -> Application Domain -> Http Runtime -> HttpContext -> MHPM(HttpModule, HttpHandler, Page life, HttpModule)


ASP.NET Web Forms Page life cycle is different from ASP.NET MVC.

In web forms, page life cycle model is:


ViewState and PostBack data are loaded in Page_PreLoad event. And Validate and Event are after Page_Load event.


Whereas in ASP.NET MVC it's more like:


There is not any code behind for pages in MVC. So, the page life cycle is totoally different.


I hope you enjoy this article. 



references:

http://msdn.microsoft.com/en-us/library/ms178473.aspx

http://msdn.microsoft.com/en-us/library/ms178472%28v=vs.100%29.aspx

http://wiki.asp.net/page.aspx/1512/

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章