开发者

HTTP request/response handling untill page life cycle commences

What happens from the point an HT开发者_运维技巧TP request is received on a TCP/IP port up until the Page fires the On_Load event?


The below link should give you detailed explanation about the asp.net application life cycle process.

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

Brifely to say.

  1. Request is received by the server, the server determines the ISAPI extension to handle the request based on filename extension.
  2. In case this is first request, it will create an app domain for maintaining isolation with this and other applications running.
  3. then it creates hosting environment which will also create the objects like HttpContext, HttpRequest and HttpResponse.
  4. After this the HTTPApplication object is created .
  5. Afterwards the events in the global.asax which is the class inherited from the HTTPApplication object fires in the order defined in the link above.


  1. The browser recieves the http response
  2. The browser parses http headers and starts reading the HTTP content.
  3. Parsing first the <head> section and parsing this, putting external resources on the get queue (first, css then javascript, ideally)
  4. Parsing the <body> content and drawing elements on the viewport.
  5. When the DOM is drawed to screen and is completely rendered. the page fires the on_load event.


When the HTTP request reaches the server, the server will then prepare the necessary file that is requested by the client and send it to the client. The client will then receive the entire content of the HTML page. Note that this is just the HTML and the browser still needs to make additional requests to the server for images and other types of files like applets if necessary.

Finally, to answer your question, it'll have to depend on where you put the onload event. If it's for the then this will be invoked when the body has completed loading. If it's in other node items, as we call it in JavaScript, then it'll be on the complete loading of that particular item.

Hope it helps :)

Cheers!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜