Bkjia.com Network ProgrammingTo understand how to process asp.net 2.0 asynchronous pages, first list the page lifecycle:
1: init event: Page initialization and initialization settings.
2: loadviewstate method: load the view State and fill in the viewstate attribute.
3: loadpostdata method: process the returned data and input form data.
4: load event: load the page. The page control is initialized and reflects the client data.
5: raisepostdatachangedevent Method: A change event is triggered when a change notification is sent back.
6: raisepostbackevent method: process the send-back event, process the client events that cause the send-back, and raise the corresponding time on the service.
7: prerender event: Page pre-rendering.
8: saveviewstate method: Save the view State and save the viewstate attribute to the string.
9: render method: displays the page.
10: dispose method: determines whether to reference expensive resources.
11: unload event: uninstall page.
Page processing method:
1: synchronous processing;
2: asynchronous processing.
Synchronous request process:
1: When asp.net receives a page request, it extracts a thread from the thread pool and assigns the request to the thread.
2: The page retains the thread during this request to prevent this thread from being used to process other requests.
3: If a synchronization request requires a long operation time, the thread allocated to the request is suspended before the return result is called.
4: Wait for the thread to return and complete other lifecycle of the page.
The relationship between the synchronization request lifecycle and the thread:
- Four pages in total:
- Previous Page
- 1
- 2
- 3
- 4
- Next Page