ASP.Net Page life Cycle Events

Below are ASP.net Page life Cycle Events:

1.PreInit
   We can use PreInit event to check IsPostBack property, if it is a new request or is it a postback. Also Master pages, Themes and profile values get set dynamically here. No control data ans control properties values from viewsate is loaded here.

2.Init
   This event get raised after all controls get initialized. Use this event to read and initialize controls properties.

3.Init Complete
  Raised by Page object and used to complete all initialization.
  
4.PreLoad
   Use this event to do some process on the controls or page before loads event occures. This load viewstate data for page and itls all contrlos

5.Load
   Page and it's all controls and controls child controlls totally get loaded during this event. Use this event to set the properties of the controls.

6.Control Events
    Use this event to handle specific controls event like button click event.

7.Load Ccomplete
   Use this event to do the tasks inorder to complete the page loading.

8. PreRender
   This event occure for every control on page and use this event to apply final changes to controls.

9.Save State complete
   This event performs the tasks that required to save view state.

10.Render
   Page object call Render method of all the controls that writes the markup for each control.

11.Unload
  This event occures for page and its all controls. Use this event to do final work on page like closinf opened files, closing database connection..etc

0 comments :

Post a Comment