Hi Friends,
Welcome in DotNet Developers Cafe. This is my first post. So, read it and enjoy...
The ASP.Net life cycle could be divided into two groups:
Welcome in DotNet Developers Cafe. This is my first post. So, read it and enjoy...
The ASP.Net life cycle could be divided into two groups:
- Application
Life Cycle
- Page
Life Cycle
ASP.Net Application Life Cycle:
The application life cycle has the following
stages:
- User
makes a request for accessing application resource, a page. Browser sends
this request to the web server.
- A
unified pipeline receives the first request and the following events take
place:
- An
object of the ApplicationManager class is created.
- An
object of the HostingEnvironment class is created to provide information
regarding the resources.
- Top
level items in the application are compiled.
- Response
objects are created . the application objects: HttpContext, HttpRequest
and HttpResponse are created and initialized.
- An
instance of the HttpApplication object is created and assigned to the
request. The request is processed by the HttpApplication class. Different
events are raised by this class for processing the request.
ASP.Net Page Life Cycle:
When a page is requested, it is loaded into the
server memory, processed and sent to the browser. Then it is unloaded from the
memory. At each of this steps, methods and events are available, which could be
overridden according to the need of the application. In other words, you can
write your own code to override the default code.
The Page class creates a hierarchical tree of
all the controls on the page. All the components on the page, except the
directives are part of this control tree. You can see the control tree by
adding trace= "true" to the Page directive. We will cover page
directives and tracing under 'directives' and 'error handling'.
The page life cycle phases are:
- Initialization
- Instantiation
of the controls on the page
- Restoration
and maintenance of the state
- Execution
of the event handler codes
- Page
rendering
Understanding the page cycle helps in writing
codes for making some specific thing happen at any stage of the page life
cycle. It also helps in writing custom controls and initializing them at right
time, populate their properties with view-state data and run control behavior
code.
Following are the different stages of an ASP.Net
page:
- Page
request . when
ASP.Net gets a page request, it decides whether to parse and compile the
page or there would be a cached version of the page; accordingly the
response is sent
- Starting
of page life cycle . at
this stage, the Request and Response objects are set. If the request is an
old request or post back, the IsPostBack property of the page is set to
true. The UICulture property of the page is also set.
- Page
initialization . at
this stage, the controls on the page are assigned unique ID by setting the
UniqueID property and themes are applied. For a new request postback data
is loaded and the control properties are restored to the view-state
values.
- Page
load . at
this stage, control properties are set using the view state and control
state values.
- Validation
. Validate
method of the validation control is called and if it runs successfully,
the IsValid property of the page is set to true.
- Postback
event handling . if
the request is a postback (old request), the related event handler is
called.
- Page
rendering . at
this stage, view state for the page and all controls are saved. The page
calls the Render method for each control and the output of rendering is
written to the OutputStream class of the Page's Response property.
- Unload
. the
rendered page is sent to the client and page properties, such as Response
and Request are unloaded and all cleanup done.
ASP.Net Page Life Cycle Events:
At each stage of the page life cycle, the page
raises some events, which could be coded. An event handler is basically a
function or subroutine, bound to the event, using declarative attributes like
Onclick or handle.
Following are the page life cycle events:
- PreInit
. PreInit is
the first event in page life cycle. It checks the IsPostBack property and
determines whether the page is a postback. It sets the themes and master
pages, creates dynamic controls and gets and sets profile property values.
This event can be handled by overloading the OnPreInit method or creating
a Page_PreInit handler.
- Init
. Init event
initializes the control property and the control tree is built. This event
can be handled by overloading the OnInit method or creating a Page_Init
handler.
- InitComplete
. InitComplete
event allows tracking of view state. All the controls turn on view-state
tracking.
- LoadViewState
. LoadViewState
event allows loading view state information into the controls.
- LoadPostData
. during
this phase, the contents of all the input fields defined with the
<form> tag are processed.
- PreLoad
. PreLoad
occurs before the post back data is loaded in the controls. This event can
be handled by overloading the OnPreLoad method or creating a Page_PreLoad
handler.
- Load
. the Load
event is raised for the page first and then recursively for all child controls.
The controls in the control tree are created. This event can be handled by
overloading the OnLoad method or creating a Page_Load handler.
- LoadComplete . the loading process is completed, control event handlers are run and page validation takes place. This event can be handled by overloading the OnLoadComplete method or creating a Page_LoadComplete handler.
- PreRender
. the
PreRender event occurs just before the output is rendered. By handling
this event, pages and controls can perform any updates before the output
is rendered.
- PreRenderComplete
. as the
PreRender event is recursively fired for all child controls, this event
ensures the completion of the pre-rendering phase.
- SaveStateComplete
. state of
control on the page is saved. Personalization, control state and view
state information is saved. The HTML markup is generated. This stage can
be handled by overriding the Render method or creating a Page_Render
handler.
- 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. This event can be handled by modifying the OnUnLoad method or
creating a Page_UnLoad handler.
If you like this post share it.. If you encounter any problems, feel free and comment below to find solution. Share Your Experience with us.
Hi Admin,
ReplyDeleteThis information is impressive; I am inspired with your post writing style & how continuously you describe this topic. After reading your post, thanks for taking the time to discuss this, I feel happy about it and I love learning more about this topic.
Regards,
Angularjs training in chennai|Node JS training|Python Training in Chennai
Excellent Post, I welcome your interest about to post blogs. It will help many of them to update their skills in their interesting field.
ReplyDeleteRegards,
Python Training in Chennai|Python training courses|Python training in velachery
Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
ReplyDeleteData Science Training in Chennai
Data science training in bangalore
Data science online training
Data science training in pune
Data science training in kalyan nagar
Data science training in Bangalore
Data science training in tambaram
Really very nice blog information for this one and more technical skills are improve,i like that kind of post.
ReplyDeleteDevops training in Chennai
Devops training in Bangalore
Devops training in Pune
Devops Online training
Devops training in Pune
Devops training in Bangalore
Devops training in tambaram
The knowledge of technology you have been sharing thorough this post is very much helpful to develop new idea. here by i also want to share this.
ReplyDeleteData Science Training in Chennai
Data science training in bangalore
Data science online training
Data science training in pune
I read this post two times, I like it so much, please try to keep posting & Let me introduce other material that may be good for our community.
ReplyDeletejava training in chennai | java training in bangalore
java training in tambaram | java training in velachery
java training in omr
Really very nice blog information for this one and more technical skills are improve,i like that kind of post.
ReplyDeletejava training in annanagar | java training in chennai
java training in marathahalli | java training in btm layout
java training in rajaji nagar | java training in jayanagar
java training in chennai
This comment has been removed by the author.
ReplyDeleteReally very nice blog information for this one and more technical skills are improve,i like that kind of post.
ReplyDeleteangularjs Training in chennai
angularjs Training in chennai
angularjs-Training in tambaram
angularjs-Training in sholinganallur
Have you been thinking about the power sources and the tiles whom use blocks I wanted to thank you for this great read!! I definitely enjoyed every little bit of it and I have you bookmarked to check out the new stuff you post
ReplyDeletepython training in OMR
python training in tambaram
python training in annanagar
Thanks for splitting your comprehension with us. It’s really useful to me & I hope it helps the people who in need of this vital information.
ReplyDeleteDevOps online Training
Best Devops Training institute in Chennai
It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
ReplyDeleteSelenium online Training | Selenium Training in Pune | Selenium Training in Bangalore
Please let me know if you’re looking for an author for your site. You have some great posts, and I think I would be a good asset. If you ever want to take some of the load off,
ReplyDeletesafety course in chennai
Really you have done great job,There are may person searching about that now they will find enough resources by your post
ReplyDeleteangularjs Training in electronic-city
angularjs online Training
angularjs Training in marathahalli
angularjs interview questions and answers
angularjs Training in bangalore
angularjs Training in bangalore
Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
ReplyDeleteangularjs-Training in sholinganallur
angularjs-Training in velachery
angularjs Training in bangalore
angularjs Training in bangalore
angularjs Training in btm
angularjs Training in electronic-city
This is an awesome post. Really very informative and creative contents. These concept is a good way to enhance the knowledge.
ReplyDeleteindustrial course in chennai
I ‘d mention that most of us visitors are endowed to exist in a fabulous place with very many wonderful individuals with very helpful things.
ReplyDeleteiosh course in chennai
Informative Blog, Thank you to share this
ReplyDeleteRegards,
Best Devops Training in Chennai | Best Devops Training Institute in Chennai
Your blog is awesome
ReplyDeleteblockchain training
thanks for your article azure online training
ReplyDeleteThanks for one marvelous posting! I enjoyed reading it; you are a great author. I will make sure to bookmark your blog and may come back someday. I want to encourage that you continue your great posts.
ReplyDeleteLearned a lot of new things from your post! Good creation and HATS OFF to the creativity of your mind. sap fico training in bangalore
ReplyDeletenice blog. thanks for sharing with us.
ReplyDeletedata science with Python Training in Bangalore
data science Python Course in Bangalore
data science with Python Classroom Training in Bangalore
data science Python Classroom Training Bangalore
react native Training in Bangalore
react native Course in Bangalore
I am impressed by the information that you have on this blog. It shows how well you understand this subject.
ReplyDeletebusiness analytics course
data analytics courses
data science interview questions
data science course in mumbai
Nice Article.very impressed for this informative
ReplyDeleteExcelR data analytics courses
This comment has been removed by the author.
ReplyDeleteNice post I have been searching for a useful post like this on salesforce course details, it is highly helpful for me and I have a great experience with this, Salesforce Training Australia
ReplyDeleteNice Post! Thank you for sharing very good post, it was so Nice to read and useful to improve my knowledge as updated one, keep blogging.
ReplyDeleteIt’s great to come across a blog every once in a while that isn’t
AWS training in chennai | AWS training in annanagar | AWS training in omr | AWS training in porur | AWS training in tambaram | AWS training in velachery
This comment has been removed by the author.
ReplyDeleteThanks for sharing this blog. concepts are very uniquely represented.
ReplyDeleteAzure Training in Chennai | Certification | Azure Online Training Course | Azure Training in Bangalore | Certification | Azure Online Training Course | Azure Training in Hyderabad | Certification | Azure Online Training Course | Azure Training in Pune | Certification | Azure Online Training Course | Azure Training | microsoft azure certification | Azure Online Training Course
Great post! I am actually getting ready to across this information, It’s very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well.It was very informative one. Thanks for sharing
ReplyDeleteData Science Training In Chennai
Data Science Online Training In Chennai
Data Science Training In Bangalore
Data Science Training In Hyderabad
Data Science Training In Coimbatore
Data Science Training
Data Science Online Training
Awesome blog it's very nice and useful i got many more information it's really nice i like your blog
ReplyDeleteAI Training in Hyderabad
I appreciate this piece of useful information. CourseDrill academy one of the best leading Training Institute, provides the best Online services with expert Team. For more information visit our site:
ReplyDeleteOracle Fusion HCM Training
Workday Training
Okta Training
Palo Alto Training
Adobe Analytics Training
The life cycle of an ASP.NET application and page is very well explained. To better understand how their code interacts with the framework, developers can benefit from your analysis of phases and events. I look forward to reading your future enlightening blogs. Continue your wonderful effort! 🚀
ReplyDeleteData Analytics Courses in India
This post provides a clear and informative overview of the ASP.NET Application and Page life cycle, making it easy for developers to understand and work with these crucial concepts. Thank you for sharing this.
ReplyDeleteData Analytics Courses in Nashik
The ASP.NET application and page life cycle is well explained in this post, making it simple for developers to comprehend and use these fundamental ideas. I appreciate you sharing this.
ReplyDeleteData Analytics Courses in Agra
It's a valuable resource for developers, and I've already liked and tweeted it to share with my network.
ReplyDeleteDigital marketing courses in illinois
Thanks for sharing valuable and incredible explanation on Application Life Cycle and Page Life Cycle.
ReplyDeleteDigital Marketing Courses in Italy
Thank you for sharing valuable knowledge on ASP.Net life cycle.
ReplyDeleteInvestment banking training Programs
Nice Post! Thank you for sharing very good post, it was so Nice to read and useful to improve my knowledge making it simple for developers to comprehend and use these fundamental ideas. I appreciate you sharing this.
ReplyDeleteData science courses in Gurgaon
Great insights on the ASP.NET application and page life cycle! Understanding these phases is essential for optimizing performance and debugging effectively. Your breakdown of each stage makes it easy for developers to grasp the flow and improve their applications. Keep up the excellent work—your content is a valuable resource for the community!
ReplyDeleteData Science Courses in Singapore
I appreciate your insights, but I think it would be helpful to include some potential pitfalls to avoid in digital marketing. It’s always good to be aware of challenges!
ReplyDeleteData science courses in Gujarat
Very nice article about asp.net. It is well written and explained. It will be helpful to many software developers. Found it interesting to read and gained much information about the topic. Thank you for sharing.
ReplyDeleteData science courses in Kochi
thank you for sharing they make it much easier to understand. Looking forward to more posts like this
ReplyDeleteData science courses in Bhutan
Best explained on The ASP.Net life cycle. Very clear and easy to understand the whole concept.
ReplyDeleteOnline Data Science Course
The way you shared your idea on ASP.net application and page life cycle made my view more clear. Thanks for provideing such valuable details.
ReplyDeleteOnline Data Science Course
"I found this article on the Data Science Course in Dadar to be very enlightening!
ReplyDeleteThe course looks like it covers all the essential skills needed today.
I’m particularly excited about the real-world projects.
It’s fantastic to see quality education options available nearby!
I’m definitely interested in enrolling!"
This article provides a detailed breakdown of the ASP.Net application and page life cycles, which is essential for developers aiming to optimize their web applications.
ReplyDeleteData science courses in Mysore
I really appreciate your vulnerability in sharing your experiences. It makes your writing feel authentic and allows readers to connect on a deeper level
ReplyDeleteData science courses in Mumbai
The post on Dotnet Developers Cafe about the ASP.NET application and page life cycle is very informative! It provides a clear breakdown of the different stages, helping developers understand how their applications process requests. The detailed explanations and visuals enhance comprehension, making it a great resource for both beginners and experienced developers. Thanks for sharing such valuable insights!
ReplyDeleteData science courses in Bangalore.
The ASP.NET Application and Page Life Cycle are crucial for understanding how ASP.NET processes and renders web pages. The Application Life Cycle manages the application's start, request handling, and end, while the Page Life Cycle handles individual pages, including stages like initialization, loading, events, rendering, and unloading.
ReplyDeleteData science Courses in Germany
If you’re ready to take charge of your career and dive into the world of data science, now’s the time! The courses featured in this post will give you the knowledge and skills to succeed in this exciting and ever-evolving field. Check out the list of courses available in Iraq here. Your future in data science starts now!
ReplyDeleteGreat explanation of the ASP.NET application and page life cycle! It’s very clear and helpful, especially for developers looking to understand the underlying flow of an ASP.NET application. I appreciate the detailed breakdown of each step—this will definitely be a valuable reference for anyone working with ASP.NET.
ReplyDeleteData science course in Gurgaon
Thank you for this comprehensive post on the ASP.NET application and page life cycle! Your clear breakdown of each stage is incredibly helpful for developers aiming to deepen their understanding of the framework.
ReplyDeleteData science course in Lucknow
You have explained The ASP.Net application in a nice way. thank you for this article.
ReplyDeleteData science courses in chennai
Thank you for this detailed explanation of the ASP.NET application and page life cycle! It's a great resource for developers to understand the internal workings and flow of an ASP.NET application. Your clear breakdown makes complex concepts much easier to grasp!
ReplyDeleteData science courses in Bangladesh
Wonderful and amazing Blog!
ReplyDeleteDigital marketing courses in mumbai
Informational blog. i found this blog very informational and intresting.
ReplyDeletetechnical writing course
Great post! This clear explanation of the ASP.NET Application and Page Life Cycles is really helpful for both beginners and experienced developers. Understanding these stages is key to optimizing performance and writing efficient code. Looking forward to more insights! Investment Banking Course
ReplyDelete