SlideShare a Scribd company logo
Life Cycle of ASP.NET
NITHIYAPRIYA PASAVARAJ
Life cycle of ASP.NET
 ASP.NET life cycle specifies, how:
 ASP.NET processes pages to produce dynamic output
 The application and its pages are instantiated and processed
 ASP.NET compiles the pages dynamically
The ASP.NET life cycle could be divided into two groups:
1. Application Life Cycle
2. 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.
 An unified pipeline receives the first request and the following
events take place:
 An object of the class ApplicationManager is created.
 An object of the class HostingEnvironment is created to provide
information regarding the resources.
 Top level items in the application are compiled.
 Response objects are created. The application objects such
as 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.
APP LIFE CYCLE
CONTINUES..
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 these 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. we can see the
control tree by adding trace= "true" to the page directive.
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.
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 the
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 on its successful execution, 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 invoked.
 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 Response property of page.
 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 such as Onclick or handle.
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 are 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.
Ad

More Related Content

What's hot (20)

Notification android
Notification androidNotification android
Notification android
ksheerod shri toshniwal
 
Asp.NET Validation controls
Asp.NET Validation controlsAsp.NET Validation controls
Asp.NET Validation controls
Guddu gupta
 
Vb.net (loop structure)
Vb.net (loop structure)Vb.net (loop structure)
Vb.net (loop structure)
Abhishek Pachisia
 
Asp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework CoreAsp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework Core
mohamed elshafey
 
Asp.net.
Asp.net.Asp.net.
Asp.net.
Naveen Sihag
 
JDBC: java DataBase connectivity
JDBC: java DataBase connectivityJDBC: java DataBase connectivity
JDBC: java DataBase connectivity
Tanmoy Barman
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
Rajkumarsoy
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET Presentation
dimuthu22
 
JVM
JVMJVM
JVM
baabtra.com - No. 1 supplier of quality freshers
 
Jsp ppt
Jsp pptJsp ppt
Jsp ppt
Vikas Jagtap
 
Lecture 1 introduction to vb.net
Lecture 1   introduction to vb.netLecture 1   introduction to vb.net
Lecture 1 introduction to vb.net
MUKALU STEVEN
 
ASP.NET Basics
ASP.NET Basics ASP.NET Basics
ASP.NET Basics
baabtra.com - No. 1 supplier of quality freshers
 
Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)
Michelle Anne Meralpis
 
Visual Studio IDE
Visual Studio IDEVisual Studio IDE
Visual Studio IDE
Sayantan Sur
 
Collections and its types in C# (with examples)
Collections and its types in C# (with examples)Collections and its types in C# (with examples)
Collections and its types in C# (with examples)
Aijaz Ali Abro
 
Master page in Asp.net
Master page in Asp.netMaster page in Asp.net
Master page in Asp.net
RupinderjitKaur9
 
JSP Directives
JSP DirectivesJSP Directives
JSP Directives
ShahDhruv21
 
Java Server Pages(jsp)
Java Server Pages(jsp)Java Server Pages(jsp)
Java Server Pages(jsp)
Manisha Keim
 
Vb.net ide
Vb.net ideVb.net ide
Vb.net ide
Faisal Aziz
 
Asp.net server controls
Asp.net server controlsAsp.net server controls
Asp.net server controls
Raed Aldahdooh
 

Similar to ASP.NET - Life cycle of asp (20)

Asp.net life cycle
Asp.net life cycleAsp.net life cycle
Asp.net life cycle
Irfaan Khan
 
Why ASP.NET Development is Important?
Why ASP.NET Development is Important?Why ASP.NET Development is Important?
Why ASP.NET Development is Important?
Ayesha Khan
 
Asp dot net lifecycle in details
Asp dot net lifecycle in detailsAsp dot net lifecycle in details
Asp dot net lifecycle in details
Ayesha Khan
 
Aspnet life cycle events
Aspnet life cycle eventsAspnet life cycle events
Aspnet life cycle events
Trushant parkar
 
Asp.net life cycle in depth
Asp.net life cycle in depthAsp.net life cycle in depth
Asp.net life cycle in depth
sonia merchant
 
Aspnetpagelifecycle 101129103702-phpapp02
Aspnetpagelifecycle 101129103702-phpapp02Aspnetpagelifecycle 101129103702-phpapp02
Aspnetpagelifecycle 101129103702-phpapp02
santoshkjogalekar
 
Asp.net control
Asp.net controlAsp.net control
Asp.net control
Paneliya Prince
 
asp-2005311dgvdfvdfvfdfvdvfdbfdb03252 (1).ppt
asp-2005311dgvdfvdfvfdfvdvfdbfdb03252 (1).pptasp-2005311dgvdfvdfvfdfvdvfdbfdb03252 (1).ppt
asp-2005311dgvdfvdfvfdfvdvfdbfdb03252 (1).ppt
Anwar Patel
 
Parallelminds.asp.net with sp
Parallelminds.asp.net with spParallelminds.asp.net with sp
Parallelminds.asp.net with sp
parallelminder
 
Page life cycle
Page life cyclePage life cycle
Page life cycle
anil4691
 
Life cycle of web page
Life cycle of web pageLife cycle of web page
Life cycle of web page
university of Gujrat, pakistan
 
Page life cycle IN ASP.NET
Page life cycle IN ASP.NETPage life cycle IN ASP.NET
Page life cycle IN ASP.NET
Sireesh K
 
As pnet pagelife_usha
As pnet pagelife_ushaAs pnet pagelife_usha
As pnet pagelife_usha
Rajalaxmi Pattanaik
 
Web controls
Web controlsWeb controls
Web controls
Sarthak Varshney
 
Asp.net page lifecycle
Asp.net page lifecycleAsp.net page lifecycle
Asp.net page lifecycle
KhademulBasher
 
Server Controls of ASP.Net
Server Controls of ASP.NetServer Controls of ASP.Net
Server Controls of ASP.Net
Hitesh Santani
 
Page life cycle
Page life cyclePage life cycle
Page life cycle
AsamHussain3
 
Aspnet Life Cycles Events
Aspnet Life Cycles EventsAspnet Life Cycles Events
Aspnet Life Cycles Events
LiquidHub
 
NET_Training.pptx
NET_Training.pptxNET_Training.pptx
NET_Training.pptx
ssuserc28c7c1
 
Learn Drupal 8 Render Pipeline
Learn Drupal 8 Render PipelineLearn Drupal 8 Render Pipeline
Learn Drupal 8 Render Pipeline
Zyxware Technologies
 
Asp.net life cycle
Asp.net life cycleAsp.net life cycle
Asp.net life cycle
Irfaan Khan
 
Why ASP.NET Development is Important?
Why ASP.NET Development is Important?Why ASP.NET Development is Important?
Why ASP.NET Development is Important?
Ayesha Khan
 
Asp dot net lifecycle in details
Asp dot net lifecycle in detailsAsp dot net lifecycle in details
Asp dot net lifecycle in details
Ayesha Khan
 
Aspnet life cycle events
Aspnet life cycle eventsAspnet life cycle events
Aspnet life cycle events
Trushant parkar
 
Asp.net life cycle in depth
Asp.net life cycle in depthAsp.net life cycle in depth
Asp.net life cycle in depth
sonia merchant
 
Aspnetpagelifecycle 101129103702-phpapp02
Aspnetpagelifecycle 101129103702-phpapp02Aspnetpagelifecycle 101129103702-phpapp02
Aspnetpagelifecycle 101129103702-phpapp02
santoshkjogalekar
 
asp-2005311dgvdfvdfvfdfvdvfdbfdb03252 (1).ppt
asp-2005311dgvdfvdfvfdfvdvfdbfdb03252 (1).pptasp-2005311dgvdfvdfvfdfvdvfdbfdb03252 (1).ppt
asp-2005311dgvdfvdfvfdfvdvfdbfdb03252 (1).ppt
Anwar Patel
 
Parallelminds.asp.net with sp
Parallelminds.asp.net with spParallelminds.asp.net with sp
Parallelminds.asp.net with sp
parallelminder
 
Page life cycle
Page life cyclePage life cycle
Page life cycle
anil4691
 
Page life cycle IN ASP.NET
Page life cycle IN ASP.NETPage life cycle IN ASP.NET
Page life cycle IN ASP.NET
Sireesh K
 
Asp.net page lifecycle
Asp.net page lifecycleAsp.net page lifecycle
Asp.net page lifecycle
KhademulBasher
 
Server Controls of ASP.Net
Server Controls of ASP.NetServer Controls of ASP.Net
Server Controls of ASP.Net
Hitesh Santani
 
Aspnet Life Cycles Events
Aspnet Life Cycles EventsAspnet Life Cycles Events
Aspnet Life Cycles Events
LiquidHub
 
Ad

More from priya Nithya (18)

Android Architecture.pptx
Android Architecture.pptxAndroid Architecture.pptx
Android Architecture.pptx
priya Nithya
 
Html server control - ASP. NET with c#
Html server control - ASP. NET with c#Html server control - ASP. NET with c#
Html server control - ASP. NET with c#
priya Nithya
 
Modes of transfer - Computer Organization & Architecture - Nithiyapriya Pasav...
Modes of transfer - Computer Organization & Architecture - Nithiyapriya Pasav...Modes of transfer - Computer Organization & Architecture - Nithiyapriya Pasav...
Modes of transfer - Computer Organization & Architecture - Nithiyapriya Pasav...
priya Nithya
 
Asynchronous data transfer
Asynchronous data transferAsynchronous data transfer
Asynchronous data transfer
priya Nithya
 
HTTP REQUEST RESPONSE OBJECT - WEB APPLICATION USING C# LAB
HTTP REQUEST RESPONSE OBJECT - WEB APPLICATION USING C# LABHTTP REQUEST RESPONSE OBJECT - WEB APPLICATION USING C# LAB
HTTP REQUEST RESPONSE OBJECT - WEB APPLICATION USING C# LAB
priya Nithya
 
HTML SERVER CONTROL - ASP.NET WITH C#
HTML SERVER CONTROL  - ASP.NET WITH C#HTML SERVER CONTROL  - ASP.NET WITH C#
HTML SERVER CONTROL - ASP.NET WITH C#
priya Nithya
 
Android LAb - Creating an android app with Radio button
Android LAb - Creating an android app with Radio buttonAndroid LAb - Creating an android app with Radio button
Android LAb - Creating an android app with Radio button
priya Nithya
 
Web application using c# Lab - Web Configuration file
Web application using c# Lab - Web Configuration fileWeb application using c# Lab - Web Configuration file
Web application using c# Lab - Web Configuration file
priya Nithya
 
Creation of simple application using - step by step
Creation of simple application using - step by stepCreation of simple application using - step by step
Creation of simple application using - step by step
priya Nithya
 
Adaptation of tcp window
Adaptation of tcp windowAdaptation of tcp window
Adaptation of tcp window
priya Nithya
 
Asp.net Overview
Asp.net OverviewAsp.net Overview
Asp.net Overview
priya Nithya
 
Key mechanism of mobile ip
Key mechanism of mobile ip Key mechanism of mobile ip
Key mechanism of mobile ip
priya Nithya
 
Mobile ip overview
Mobile ip overviewMobile ip overview
Mobile ip overview
priya Nithya
 
Features of mobile ip
Features of mobile ipFeatures of mobile ip
Features of mobile ip
priya Nithya
 
Creating a Name seperator Custom Control using C#
Creating a Name seperator Custom Control using C#Creating a Name seperator Custom Control using C#
Creating a Name seperator Custom Control using C#
priya Nithya
 
How to Create Database component -Enterprise Application Using C# Lab
How to Create Database component -Enterprise Application Using C# Lab  How to Create Database component -Enterprise Application Using C# Lab
How to Create Database component -Enterprise Application Using C# Lab
priya Nithya
 
Creating simple component
Creating simple componentCreating simple component
Creating simple component
priya Nithya
 
Internet (i mcom)
Internet (i mcom)Internet (i mcom)
Internet (i mcom)
priya Nithya
 
Android Architecture.pptx
Android Architecture.pptxAndroid Architecture.pptx
Android Architecture.pptx
priya Nithya
 
Html server control - ASP. NET with c#
Html server control - ASP. NET with c#Html server control - ASP. NET with c#
Html server control - ASP. NET with c#
priya Nithya
 
Modes of transfer - Computer Organization & Architecture - Nithiyapriya Pasav...
Modes of transfer - Computer Organization & Architecture - Nithiyapriya Pasav...Modes of transfer - Computer Organization & Architecture - Nithiyapriya Pasav...
Modes of transfer - Computer Organization & Architecture - Nithiyapriya Pasav...
priya Nithya
 
Asynchronous data transfer
Asynchronous data transferAsynchronous data transfer
Asynchronous data transfer
priya Nithya
 
HTTP REQUEST RESPONSE OBJECT - WEB APPLICATION USING C# LAB
HTTP REQUEST RESPONSE OBJECT - WEB APPLICATION USING C# LABHTTP REQUEST RESPONSE OBJECT - WEB APPLICATION USING C# LAB
HTTP REQUEST RESPONSE OBJECT - WEB APPLICATION USING C# LAB
priya Nithya
 
HTML SERVER CONTROL - ASP.NET WITH C#
HTML SERVER CONTROL  - ASP.NET WITH C#HTML SERVER CONTROL  - ASP.NET WITH C#
HTML SERVER CONTROL - ASP.NET WITH C#
priya Nithya
 
Android LAb - Creating an android app with Radio button
Android LAb - Creating an android app with Radio buttonAndroid LAb - Creating an android app with Radio button
Android LAb - Creating an android app with Radio button
priya Nithya
 
Web application using c# Lab - Web Configuration file
Web application using c# Lab - Web Configuration fileWeb application using c# Lab - Web Configuration file
Web application using c# Lab - Web Configuration file
priya Nithya
 
Creation of simple application using - step by step
Creation of simple application using - step by stepCreation of simple application using - step by step
Creation of simple application using - step by step
priya Nithya
 
Adaptation of tcp window
Adaptation of tcp windowAdaptation of tcp window
Adaptation of tcp window
priya Nithya
 
Key mechanism of mobile ip
Key mechanism of mobile ip Key mechanism of mobile ip
Key mechanism of mobile ip
priya Nithya
 
Mobile ip overview
Mobile ip overviewMobile ip overview
Mobile ip overview
priya Nithya
 
Features of mobile ip
Features of mobile ipFeatures of mobile ip
Features of mobile ip
priya Nithya
 
Creating a Name seperator Custom Control using C#
Creating a Name seperator Custom Control using C#Creating a Name seperator Custom Control using C#
Creating a Name seperator Custom Control using C#
priya Nithya
 
How to Create Database component -Enterprise Application Using C# Lab
How to Create Database component -Enterprise Application Using C# Lab  How to Create Database component -Enterprise Application Using C# Lab
How to Create Database component -Enterprise Application Using C# Lab
priya Nithya
 
Creating simple component
Creating simple componentCreating simple component
Creating simple component
priya Nithya
 
Ad

Recently uploaded (20)

CNS infections (encephalitis, meningitis & Brain abscess
CNS infections (encephalitis, meningitis & Brain abscessCNS infections (encephalitis, meningitis & Brain abscess
CNS infections (encephalitis, meningitis & Brain abscess
Mohamed Rizk Khodair
 
Myasthenia gravis (Neuromuscular disorder)
Myasthenia gravis (Neuromuscular disorder)Myasthenia gravis (Neuromuscular disorder)
Myasthenia gravis (Neuromuscular disorder)
Mohamed Rizk Khodair
 
Myopathies (muscle disorders) for undergraduate
Myopathies (muscle disorders) for undergraduateMyopathies (muscle disorders) for undergraduate
Myopathies (muscle disorders) for undergraduate
Mohamed Rizk Khodair
 
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
Dr. Nasir Mustafa
 
LDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDMMIA Reiki News Ed3 Vol1 For Team and GuestsLDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDM Mia eStudios
 
puzzle Irregular Verbs- Simple Past Tense
puzzle Irregular Verbs- Simple Past Tensepuzzle Irregular Verbs- Simple Past Tense
puzzle Irregular Verbs- Simple Past Tense
OlgaLeonorTorresSnch
 
How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18
Celine George
 
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon DolabaniHistory Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
fruinkamel7m
 
All About the 990 Unlocking Its Mysteries and Its Power.pdf
All About the 990 Unlocking Its Mysteries and Its Power.pdfAll About the 990 Unlocking Its Mysteries and Its Power.pdf
All About the 990 Unlocking Its Mysteries and Its Power.pdf
TechSoup
 
MEDICAL BIOLOGY MCQS BY. DR NASIR MUSTAFA
MEDICAL BIOLOGY MCQS  BY. DR NASIR MUSTAFAMEDICAL BIOLOGY MCQS  BY. DR NASIR MUSTAFA
MEDICAL BIOLOGY MCQS BY. DR NASIR MUSTAFA
Dr. Nasir Mustafa
 
Cultivation Practice of Garlic in Nepal.pptx
Cultivation Practice of Garlic in Nepal.pptxCultivation Practice of Garlic in Nepal.pptx
Cultivation Practice of Garlic in Nepal.pptx
UmeshTimilsina1
 
Drugs in Anaesthesia and Intensive Care,.pdf
Drugs in Anaesthesia and Intensive Care,.pdfDrugs in Anaesthesia and Intensive Care,.pdf
Drugs in Anaesthesia and Intensive Care,.pdf
crewot855
 
2025 The Senior Landscape and SET plan preparations.pptx
2025 The Senior Landscape and SET plan preparations.pptx2025 The Senior Landscape and SET plan preparations.pptx
2025 The Senior Landscape and SET plan preparations.pptx
mansk2
 
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptxANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
Mayuri Chavan
 
Overview Well-Being and Creative Careers
Overview Well-Being and Creative CareersOverview Well-Being and Creative Careers
Overview Well-Being and Creative Careers
University of Amsterdam
 
The role of wall art in interior designing
The role of wall art in interior designingThe role of wall art in interior designing
The role of wall art in interior designing
meghaark2110
 
Form View Attributes in Odoo 18 - Odoo Slides
Form View Attributes in Odoo 18 - Odoo SlidesForm View Attributes in Odoo 18 - Odoo Slides
Form View Attributes in Odoo 18 - Odoo Slides
Celine George
 
antiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidenceantiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidence
PrachiSontakke5
 
Module 1: Foundations of Research
Module 1: Foundations of ResearchModule 1: Foundations of Research
Module 1: Foundations of Research
drroxannekemp
 
How to Manage Amounts in Local Currency in Odoo 18 Purchase
How to Manage Amounts in Local Currency in Odoo 18 PurchaseHow to Manage Amounts in Local Currency in Odoo 18 Purchase
How to Manage Amounts in Local Currency in Odoo 18 Purchase
Celine George
 
CNS infections (encephalitis, meningitis & Brain abscess
CNS infections (encephalitis, meningitis & Brain abscessCNS infections (encephalitis, meningitis & Brain abscess
CNS infections (encephalitis, meningitis & Brain abscess
Mohamed Rizk Khodair
 
Myasthenia gravis (Neuromuscular disorder)
Myasthenia gravis (Neuromuscular disorder)Myasthenia gravis (Neuromuscular disorder)
Myasthenia gravis (Neuromuscular disorder)
Mohamed Rizk Khodair
 
Myopathies (muscle disorders) for undergraduate
Myopathies (muscle disorders) for undergraduateMyopathies (muscle disorders) for undergraduate
Myopathies (muscle disorders) for undergraduate
Mohamed Rizk Khodair
 
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
Dr. Nasir Mustafa
 
LDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDMMIA Reiki News Ed3 Vol1 For Team and GuestsLDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDM Mia eStudios
 
puzzle Irregular Verbs- Simple Past Tense
puzzle Irregular Verbs- Simple Past Tensepuzzle Irregular Verbs- Simple Past Tense
puzzle Irregular Verbs- Simple Past Tense
OlgaLeonorTorresSnch
 
How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18
Celine George
 
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon DolabaniHistory Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
fruinkamel7m
 
All About the 990 Unlocking Its Mysteries and Its Power.pdf
All About the 990 Unlocking Its Mysteries and Its Power.pdfAll About the 990 Unlocking Its Mysteries and Its Power.pdf
All About the 990 Unlocking Its Mysteries and Its Power.pdf
TechSoup
 
MEDICAL BIOLOGY MCQS BY. DR NASIR MUSTAFA
MEDICAL BIOLOGY MCQS  BY. DR NASIR MUSTAFAMEDICAL BIOLOGY MCQS  BY. DR NASIR MUSTAFA
MEDICAL BIOLOGY MCQS BY. DR NASIR MUSTAFA
Dr. Nasir Mustafa
 
Cultivation Practice of Garlic in Nepal.pptx
Cultivation Practice of Garlic in Nepal.pptxCultivation Practice of Garlic in Nepal.pptx
Cultivation Practice of Garlic in Nepal.pptx
UmeshTimilsina1
 
Drugs in Anaesthesia and Intensive Care,.pdf
Drugs in Anaesthesia and Intensive Care,.pdfDrugs in Anaesthesia and Intensive Care,.pdf
Drugs in Anaesthesia and Intensive Care,.pdf
crewot855
 
2025 The Senior Landscape and SET plan preparations.pptx
2025 The Senior Landscape and SET plan preparations.pptx2025 The Senior Landscape and SET plan preparations.pptx
2025 The Senior Landscape and SET plan preparations.pptx
mansk2
 
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptxANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
Mayuri Chavan
 
Overview Well-Being and Creative Careers
Overview Well-Being and Creative CareersOverview Well-Being and Creative Careers
Overview Well-Being and Creative Careers
University of Amsterdam
 
The role of wall art in interior designing
The role of wall art in interior designingThe role of wall art in interior designing
The role of wall art in interior designing
meghaark2110
 
Form View Attributes in Odoo 18 - Odoo Slides
Form View Attributes in Odoo 18 - Odoo SlidesForm View Attributes in Odoo 18 - Odoo Slides
Form View Attributes in Odoo 18 - Odoo Slides
Celine George
 
antiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidenceantiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidence
PrachiSontakke5
 
Module 1: Foundations of Research
Module 1: Foundations of ResearchModule 1: Foundations of Research
Module 1: Foundations of Research
drroxannekemp
 
How to Manage Amounts in Local Currency in Odoo 18 Purchase
How to Manage Amounts in Local Currency in Odoo 18 PurchaseHow to Manage Amounts in Local Currency in Odoo 18 Purchase
How to Manage Amounts in Local Currency in Odoo 18 Purchase
Celine George
 

ASP.NET - Life cycle of asp

  • 1. Life Cycle of ASP.NET NITHIYAPRIYA PASAVARAJ
  • 2. Life cycle of ASP.NET  ASP.NET life cycle specifies, how:  ASP.NET processes pages to produce dynamic output  The application and its pages are instantiated and processed  ASP.NET compiles the pages dynamically The ASP.NET life cycle could be divided into two groups: 1. Application Life Cycle 2. Page Life Cycle
  • 3. 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.  An unified pipeline receives the first request and the following events take place:  An object of the class ApplicationManager is created.  An object of the class HostingEnvironment is created to provide information regarding the resources.  Top level items in the application are compiled.
  • 4.  Response objects are created. The application objects such as 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. APP LIFE CYCLE CONTINUES..
  • 5. 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 these 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. we can see the control tree by adding trace= "true" to the page directive.
  • 6. 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.
  • 7. 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 the 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.
  • 8.  Validation - Validate method of the validation control is called and on its successful execution, 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 invoked.  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 Response property of page.  Unload - The rendered page is sent to the client and page properties, such as Response and Request, are unloaded and all cleanup done.
  • 9. 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 such as Onclick or handle.
  • 10. 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.
  • 11.  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 are 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.
  • 12.  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.
  • 13.  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.
  翻译: