ASP.Net Page Lifecycle Events

We all know a asp.net page events, but do we exactly know the orders? and what each event is good for?

well I am putting this list together to talk about the events.

  • PreInit
  • use this event to:
    • Set a master page dynamically.
    • Set the Theme property dynamically.
    • Read or set profile property values.

  • Init
  • Use this event to read or initialize control properties
  • InitComplete
  • Use this event to make changes to view state that you want to make sure are persisted after the next postback.
  • LoadState
  • ProcessPostData
  • PreLoad
  • Load
  • LoadComplete
  • PreRender
  • if you have got custom controls on your page and you want to manupulate the final page output based on some values in a custom control, you need to put your logic in this event.
  • SaveState
  • Any changes to the page or controls at this point affect rendering, but the changes will not be retrieved on the next postback.
  • Render

Written by vahid

Wednesday, March 7, 2012 at 5:10 AM

Tagged with

Leave a Reply