Methods fired during the page load - ASP.NET

What are the methods fired during the page load? Explain each of them.

Init() :

- When the page is instantiated.
- Raised after all controls have been initialized and any skin settings have been applied.
- The Init event of individual controls occurs before the Init event of the page.
- Use this event to read or initialize control properties.

Load() :

- When the page is loaded into server memory.
- The Page object calls the OnLoad method on the Page object, and then recursively does the same for each child control until the page and all controls are loaded.
- The Load event of individual controls occurs after the Load event of the page.
- Use the OnLoad event method to set properties in controls and to establish database connections.

PreRender() :

- The brief moment before the page is displayed to the user as HTML.
- Raised after the Page object has created all controls that are required in order to render the page, including child controls of composite controls.
- The Page object raises the PreRender event on the Page object, and then recursively does the same for each child control.
- The PreRender event of individual controls occurs after the PreRender event of the page.
- Use the event to make final changes to the contents of the page or its controls before the rendering stage begins.

Unload() :

- When page finishes loading. Raised for each control and then for the page.
- In controls, use this event to do final cleanup for specific controls, such as closing control-specific database connections.
- For the page itself, use this event to do final cleanup work, such as closing open files and database connections, or finishing up logging or other request-specific tasks.
Concept, capabilities and features ADO.NET
Concept, capabilities and features ADO.NET - It is data-access technology, primarily disconnected and designed to provide efficient....
Server-side and Client-side code in ASP.NET
ASP.NET - Server-side and Client-side code - Server-side code runs on the server....
Tag to add a hyperlink column to the DataGrid - ASP.NET
ASP.NET - Tag to add a hyperlink column to the DataGrid..
Post your comment