|
||
Page life cycleThe .aspx mechanism is most detailed HttpHandler in ASP.NET .this HttpHandler fires events along its Life cycle so it is possible to write code between the creation steps of the page. The Life cycle of The .aspx, depends on whether the page is requested for the first time or it is a postback. The events: PreInit This event is the beginning of the page life cycle. Every page controls are initialized and the properties are set according to aspx source code.
First, the Init event for the Page object occurs, then Init event occurs for each control on the Page. Viewstate information is not available at this stage.
During this phase, the view state of the control posted by the client is reloaded into the new instance of the control. LoadPostData when PostBack is trueDuring this phase, the server searches any data corresponding to the control that is loaded in the data posted by the client. InitCompleteThis event is used to processing tasks that require all initialization be complete. PreLoadThis event is used before Perform any processing that should occur before Load. Use this event if you need to perform processing on your page or control before the Load event. Before the Page instance raises this event, it loads view state for itself and all controls, and then processes any postback data included with the Request instance. LoadSet properties in controls and establish database connection Control EventsThese are control specific events such as – Button Click, DropDownIndexChanged etc. Load CompleteThis event is used for performing those tasks which require load has been completed. RaisePostBackEvent when PostBack is trueDuring this phase, the server searches any data corresponding to the control that is loaded in the data posted by the client. PreRenderIn this event page insures that all child controls are created. Page calls EnsureChildControls for all controls, including itself. Every controls whose datasource/databind property is set calls for its databind method. SaveStateCompleteThis event occurs after viewstate encoded and saved for the page and for all controls. RenderEvery ASP.NET control has render method and the page instance calls this method to output the control’s markup, after this event any changes to the page or controls are ignored. UnloadUnload event used to do cleanup task like closing the database connections, closing of the open files, completing logging or other requested tasks. Unload events occurs for each control on page control tree first and after that page.
|
|
HOME|
IIS6 pipeline|
ASP.NET pipeline|
Http Modules|
Http Handlers|
Caching|
Web Services|
Page Life Cycle|
Ajax|
Jquery|
Session State ViewState| SEO| Mobile Basics| Mobile Handsets| C# Modifiers| C# Keywords| N-Tier| Design patterns| Stack & Heap| WCF Databases| Relational Model| functionalities| Stored procedures| fishmarket |
|
| © 2010 All Rights Reserved |