ASP.NET Page Life Cycle explained

When a page request is sent to the Web server, the page is run through a series of events during its creation and disposal. In this article, I will discuss in detail the ASP.NET page life cycle Events

(1) PreInit The entry point of the page life cycle is the pre-initialization phase called “PreInit”. This is the only event where programmatic access to master pages and themes is allowed. You can dynamically set the values of master pages and themes in this event. You can also dynamically create controls in this event.

EXAMPLE : Override the event as given below in your code-behind cs file of your aspx page


(2)Init This event fires after each control has been initialized, each control’s UniqueID is set and any skin settings have been applied. You can use this event to change initialization values for controls. The “Init” event is fired first for the most bottom control in the hierarchy, and then fired up the hierarchy until it is fired for the page itself.

EXAMPLE : Override the event as given below in your code-behind cs file of your aspx page


Similar Topics:

Tags:

asp net page life cycle events with exampleasp net page life cycle with examplepage life cycle in asp net with exampleasp net page life cycle in detailasp net life cycle in detailasp net page life cycle examplepagelife cycle in asp net with examplepage life cycle in asp netasp net page life cycle with examplespage life cycle events in asp net with examples
We will send you more information on ASP.NET Page Life Cycle explained.
Enter your email address:
This entry was posted in .Net and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *