Thursday, December 27, 2007

What Methods are fired during the page load? / Web Form Events

Life Cycle of ASP.NET Request

From the moment a user first requests an ASP.NET Web Form to the moment the server actually sends the response, quite a few events and processes occur. A few of the most important ones are described in the following sections.

Init() - when the page is instantiated (Initialize objects and variables needed throughout the life cycle of the request.)

LoadViewState() – View state information is loaded into the viewStatepropery of web controls that have it enabled.

Load() - when the page is loaded into server memory. (All the controls are loaded and initialized and their properties set.)

SaveViewState() – View state information is serialized to a string. The information is transmitted to the client in a hidden form.

PreRender() - the brief moment before the page is displayed to the user as HTML. (Output is generated to the clent.)

Dispose() – Final cleanup of objects associated with the request.Unload() - when page finishes loading.

No comments: