What is the sequence in which ASP.NET page life cycle is executed ?

 Posted by articlesmaint on 2/22/2011 | Category: ASP.NET Interview questions | Views: 11626

This is a great  and the most asked ASP.NET interview question. Out of 100 .NET interviews atleast 70 interviewer will ask this question. The answer is very simple but the problem with the answer is that developers forget the  sequence of ASP.NET page life cycle.

The best way to remember this answer is by remembering the word SILVER.

S (Well this word is just to make up the word , you can just skip this.)
I (Init)
L (Load)
V (Validate)
E (Event)
R (Render)

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Kishork80 on: 2/23/2011
The current ASP.NET 3.5 synchronous pipeline events are listed in the order that they occur as follows:
1. BeginRequest
2. AuthenticateRequest
3. PostAuthenticateRequest
4. AuthorizeRequest
5. PostAuthorizeRequest
6. ResolveRequestCache
7. PostResolveRequestCache
8. MapRequestHandler
9. PostMapRequestHandler
10. AcquireRequestState
11. PostAcquireRequestState
12. PreRequestHandlerExecute
At this stage, the selected handler executes the current request. The most familiar handler is the
Page handler.
13. PostRequestHandlerExecute
14. ReleaseRequestState
15. PostReleaseRequestState
16. UpdateRequestCache
17. PostUpdateRequestCache
18. LogRequest
19. PostLogRequest
20. EndRequest
ASP.NET 3.5 adds three new stages to the unified integrated request-processing pipeline. These events are only used when the integrated mode is configured:
1. MapRequestHandler : At this stage a handler is selected based on the content file type extension that is requested. Either a native module such as the StaticFileModule handler or a managed module such as PageHandlerFactory can be selected
2. LogRequest: Fires just after the PostUpdateRequestCache event. Even if an error occurs in the request processing, this even still fires. Both native and managed modules can subscribe to this event.
3. PostLogRequest: This event fires just after LogRequest event fires.
Posted by: Questpond on: 2/23/2011
The above answer is good....but i wonder do we have time to really all those points in the interview....So how about keeping simple SILVER

Thanks for your answer.

Login to post response