Why is knowing the Asp.net lifecyle important to coding in Asp.net?
ASP.NET Page Lifecycle. In ASP.NET, a web page has execution lifecycle that includes various phases. These phases include initialization, instantiation, restoring and maintaining state etc. it is required to understand the page lifecycle so that we can put custom code at any stage to perform our business logic.
UnLoad - The UnLoad phase is the last phase of the page life cycle. It raises the UnLoad event for all controls recursively and lastly for the page itself. Final cleanup is done and all resources and references, such as database connections, are freed.
ASP.NET Page Life Cycle includes events PreInit, Init, InitComplete, OnPreLoad, Load, PostBack, LoadComplete, OnPreRender, OnSaveStateComplete, Render, and UnLoad.
Every request for a page made from a web server causes a chain of events at the server. These events, from beginning to end, constitute the life cycle of the page and all its components. The life cycle begins with a request for the page, which causes the server to load it.
Because otherwise, you will end up making false assumptions about your code.
It is never a good idea to develop for a platform without understanding how that platform works.
At the very least, all ASP.Net developers must understand the difference between client-side code (Javascript) and server-side code (C#), and how the postback model works.
It is also a good idea to understand ViewState and session.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With