get the app get the app       get the app       get the app
Please briefly explain ASP.NET Page life Cycle?

  • : 312
  • : 16
    Previous Next

    ASP.NET Web Forms uses Page controller pattern approach for rendering layout. In this approach, every page has it's own controller i.e. code-behind file that processes the request. On the other hand, ASP.NET MVC uses Front Controller approach. In this approach a common controller for all pages, processes the requests.

    Please follow for detailed information on WebForms Vs MVC.

    Please briefly explain ASP.NET Page life Cycle?

    ASP.NET page passes through a series of steps during its life cycle. Following is the high-level explanation of life cycle stages/steps.

    Initialization: Controls raise their Init event in this stage.Objects and variables are initializes for complete lifecyle of request.

    LoadViewState: is a post back stage and loads the view state for the controls that enabled its view state property.

    LoadPostBackData: is also a post back stage and loads the data posted for the controls and update them.

    Load: In this stage page as well as all the controls raise their Load event. Till this stage all the controls are initialized and loaded. In most of the cases, we are coding this event handler.

    RaisePostBackEvent: is again a postback stage. For example, it's raise against a button click event. We can easily put our code here to perform certain actions.

    SaveViewState: Finally, controls state is saved in this stage before Rendering HTML.

    Render: This is the stage where HTML is generated for the page.

    Dispose: Lastly, all objects associated with the request are cleaned up.

    you can suggest other answer in comment box

  • Exam: ASP .NET Interview Questions

    Subscribe here for free mock test on IAS PCS SSC and other competitive exam. Signup here to get SSC CGL Solution and main exam study material