If you are a beginner in ASP.NET, You Should understand the life-cycle of an ASP.NET Application In web development.
Whenever a user tries to access a particular page or when a page is requested by the user from the browser, the request goes through a series of steps and numerous processes run under the hood in the background, in order to produce the output or send the response back to the client.
The time period and the processes that run between the request and response of a page is called the "Page Life Cycle".
Request:- Start of the life cycle (sent by the user).
Response:- End of the life cycle (sent by the server).
The application life cycle has the following stages to put them into brief:-
The life-cycle of an ASP.NET page
Whenever someone requests a page, it gets loaded into the server memory, processed, and sent back to the browser. It then gets unloaded from the memory. During each of these steps, methods and events are available, and there is a chance that it could be overridden according to the needs of the application. At the same time, one can write their own code to override the default code.
The Page class engineers a hierarchical tree of all the controls on the page. Every single component on the page, except the directives, becomes a part of this control tree. You can see the control tree by adding trace= "true" to the page directive.
What are the events that occur in ASP.NET page life-cycle
During each stage of the page life cycle, the page raises some events, which could be coded. Talking about event handler, it is a function or subroutine, bound to the event, using declarative attributes such as Onclick or handle.
PreInit - This is the first event in the page life cycle. It checks the IsPostBack property and establishes whether the page is a postback. It helps in setting up the themes and master pages, creates dynamic controls, and gets and sets profile property values. This particular event can be handled by overloading the OnPreInit method or creating a Page_PreInit handler.
Init - Init event kickstarts the control property and the control tree gets built. The event can be handled by overloading the OnInit method or creating a Page_Init handler.
InitComplete - InitComplete event enables tracking of view state. Each and every controls turn on view-state tracking.
LoadViewState - LoadViewState event allows loading view state information straight into the controls.
LoadPostData - At the time of this phase, the contents of all the input fields are defined with the <form> tag are processed.
PreLoad - The PreLoad event unfolds right before the postback data is loaded in the controls. This event can easily be handled by overloading the OnPreLoad method or creating a Page_PreLoad handler.
Load - This event is raised for the page first and after that, recursively for all the child controls. The controls in the control tree are created. One can handle this event by overloading the OnLoad method or creating a Page_Load handler.
ASP.NET has a long lasting future. Most of the web development today is done on ASP.NET pages. Today you can easily hire ASP.NET developers and start building your dream website today.
Looking to outsource your asp dot net development requirement? ASP.Net is a special feature of the DOT Net framework created by Microsoft. At [HourlyDeveloper.io](https://hourlydeveloper.io/ "HourlyDeveloper.io"), we have a team of experienced...
In this blog post, I will share the Free e-book: Blazor for ASP.NET Web Forms Developers PDF. This book is great for ASP.NET Web Forms developers looking for guidelines. As well as strategies for migrating their existing apps to a modern, open-source, and cross-platform web framework.
Releasing new e-book: Blazor for ASP.NET Web Forms Developers. It covers guidelines and strategies for migrating existing apps to a modern web framework.
Leading ASP.NET Development Company CISIN offers custom asp.net Development Services and ASP.NET Web Development with optimum quality on dot net programming.
**[Hire ASP.NET Developers](https://www.dataeximit.com/hire-asp-net-developer/ "Hire ASP.NET Developers")** from **Data EximIT** to revamp your existing web applications or customize the new one! Our Dedicated ASP.NET Developers can help you to...