ASP.NET - The Page Class

All Web forms are instances of the ASP.NET Page class, which is defined in the System.Web.UI namespace. The Page class inherits theTemplateControl class, which in turn, inherits the Control class. As a result, the Page class provides useful events that can be used in the code.

Page Events
ASP.NET uses an event-driven model of programming. This model of ASP.NET defines a sequence of events that are raised during the lifecycle of a Web page. Following are some of the page events:
  • Init - It is the first event that occurs when the server executes an ASP.NET page. It occurs only once in the entire lifecycle of an ASP.NET page.
  • Load - It is fired after the Init event, when the page is requested for the first time and whenever the page is reloaded. This page is used to initialize the variables and the state of controls that are used in the page.

No comments: