0
2.0kviews
Life cycle of ASP.NET application

Mumbai University > Information Technology > Sem 4 > Web Programming

Marks: 5M

Year: May 2015

1 Answer
0
1views
  • The aspx page goes through a series of procedures while loading. When an initial request is received by ASP.NET,it locates and loads the requested Web Form.
  • The ASP.NET Page goes through a series of procedures to initiate actions at specific moments when the page is either created or destroyed.

The Life Cycle events of ASP.NET application are as follows:

  1. Pre-Init: It is called at the beginning of page initialization stage.In this method , personalization information is loaded and the page theme if applicable is initialized.This is also the preffered stage to dynamically initialize a Page Theme or Master Page for aspx page.
  2. Init : It performs the initialization and setup steps required to create a Page instance. In this stage, the server controls on the page are initialized to default state. However, the viewstate of the controls is not yet populated. 3.LoadViewState : It restores viewstate information. 4.LoadPostData: The information that is posted by the browser is given or consumed here.
  3. InitComplete: It is called after the page initialization is complete. All the controls are completely initialized.The user can access servercontrols. However they will not contain information returned by the user.
  4. PreLoad: It is called after the PostBack data is returned from the user is loaded. Controls created in the Pre-Load method will also be loaded with the viewstate and postback data.
  5. Load: It notifies the server control that should perform actions common to HTTP request for the page it is associated with, like setting up a database query. At this stage in the page life cycle, the server controls in the hierarchy are created and initialized, view state is restored and form controls reflect client side data.
  6. Pre-Render : It is called after the LoadComplete method. It notifies the server control to perform any necessary pre-rendering steps prior to saving view state and rendering content. 9.PreRenderComplete: All the controls are created and the Page is ready to render output at this stage. This is the last event that is called before the page’s viewstate is saved.
  7. Render : It initializes the HTMLTextWriter object and calls on the child controls of the page to render. The Render method creates the text and markup that is sent to the client browser.
  8. Unload: It is typically used for cleanup functions that precede disposition of the control.

enter image description here

Please log in to add an answer.