Thursday, April 26, 2012

Page Life Cycle Satges

When an user requests for a page from browser then ASP.Net serves the page to the client/user during this service page passes via some stages this cycle of page processing is called Asp.Net Page Life Cycle.
All stages of page life cycle performed for partial page processing request also.(Like to process update panel.)

1. Page request - Page request raised before page life cycle started. Here Asp.net determines that a cached page can be served or need to compile and parse the page. If cached page not served then page life cycle is started.

2. Start - At this stage Request and response properties of page are set. Page determines that is it a postback then Ispostback property of page is set, also set UIculture property of page at this stage.

3. Initialization - At this stage controls of page are available, Unique Id property is set here for all controls of page. Master page and themes also applied to the page if applicable.

4. Load - At this stage properties of controls are initialize by values picked from View State and Control state, if page is postback.

5. Postback event handling - If page is postback then event handlers of controls are called. After that Validate method of all validation controls are called and IsValid property of validation controls and page is set.(An exception to this sequence is) Event handler that caused validation called after validation.

6. Render - At this stage View state is saved. Page calls Render method of all controls, with providing TextWriter so that out put is written to OutputStream object of Response property of page.

7. Unload - This stage occurred when page is fully rendered and sent to client. Response and request properties and other properties of page are unloaded and dispose is performed for all.

No comments:

Post a Comment

CI/CD - Safe DB Changes/Migrations

Safe DB Migrations means updating your database schema without breaking the running application and without downtime . In real systems (A...