ASP.NET page life cycle explanation

Sharique picture Sharique · Dec 10, 2011 · Viewed 104k times · Source

I was asked to explain the ASP.NET page life cycle in an interview some time back. I did explain it to him, but he was not satisfied with my answer. Could someone explain the life cycle to me please?

Answer

Shivprasad Koirala picture Shivprasad Koirala · Dec 6, 2015

There are 10 events in ASP.NET page life cycle, and the sequence is:

  1. Init
  2. Load view state
  3. Post back data
  4. Load
  5. Validate
  6. Events
  7. Pre-render
  8. Save view state
  9. Render
  10. Unload

Below is a pictorial view of ASP.NET Page life cycle with what kind of code is expected in that event. I suggest you read this article I wrote on the ASP.NET Page life cycle, which explains each of the 10 events in detail and when to use them.

ASP.NET life cycle

Image source: my own article at https://www.c-sharpcorner.com/uploadfile/shivprasadk/Asp-Net-application-and-page-life-cycle/ from 19 April 2010