ASP.NET - Application Life Cycle Principle

发布时间:2017-09-09 10:46:33
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.

,站群,站群系统

企业建站2800元起,携手武汉肥猫科技,做一个有见地的颜值派!更多优惠请戳:孝感网站建设 http://xiaogan.45qun.com