SlideShare a Scribd company logo
Presented By : Abhishek Sur
http://www.abhisheksur.com/
Table of Content
 Introduction
 Application Life Cycle
 IIS Request Process
 Application Pool
 Worker Process
 HTTP Handler/Module
 ASP.NET Page Life Cycle
 Page Life Cycle Steps
 Page Life Cycle Events
 Life Cycle for Master Page and User Control
 QA
Introduction
 When Clients request for an aspx page from browser
and lot of stuffs happens in background to produce the
output or sending response to client. This evolves
ASP.NET Page Lifecycle.
 ASP.NET Page Life Cycle is very much important to
know for each and every developer to developed an
ASP.NET Web Application.
 All events, data processing, dynamic control creation,
view state, postback, rendering etc. are depends with
Page Life Cycle.
Application Life Cycle
1. Client Request For Information
2. Request comes to Server
3. Server Process the request
4. Send the response back to Client
Application Life Cycle - Contd.
 Key terms to remember
 HTTP.SYS
 WAS
 Application Pool
 Worker Process
http://blogs.thesitedoctor.co.uk/tim/2006/06/30/Complete+Lifecycle+Of+A
n+ASPNet+Page+And+Controls.aspx
Application Life Cycle – Contd.
 Key Terms To Remember
 Http Module
 Http Handler
 Http Pipeline
End Of Application Life Cycle – Start Page Life Cycle
 Request Passes Through HTTP Pipe Line
 This Start Page Life Cycle
ASP.NET Page Life Cycle Begins
 Start
 Initialization
 Load
 Validation
 Events
 Render
S I L
VER
Page Life Cycle - Start
 Client Request For Resource
 Request Comes To Server (IIS)
 IIS Process the Initial Processing
 Request Passed through HTTP- Pipe Line
 ASP.NET Page Life Cycle Starts
Page Life Cycle - Initialization
 Set Postback properties
 Unique ID for Each Control in the Page
 Themes needs to be initialized
 Dynamic control need to be created
Page Life Cycle - Load
 If the Request is the post back request then it loads
data from View States and Control State
Page Life Cycle - Validation
 Validate the pages Control
 Updates the IsValid property
Page Life Cycle - Events
 This will only fired if the request is an postback event.
 Like, if the post back is happened for an Button Click.
Button Click event will fired.
Page Life Cycle - Render
 Before Rendering All View State data has been set.
 Render() method for all control has been called and
write the out put on output stream.
Page Life Cycle - Events
http://msdn.microsoft.com/en-us/library/ms178472.aspx
ASP.NET Page Life Cycle Events
 PreInit
 Init
 PreLoad
 Load
 Control Events
 PreRender
 SaveViewState
 Render
 Unload
Page Life Cycle – Events
 PreInit()
 This is the first event which raised in asp.net page lifecycle
 Check for Request is for Post Back or not.
 All dynamic control need to be created
 Theme Change, Master Page Set at runtime
 Init()
 Raised after all controls have been initialized
 Build up a tree of controls from the ASPX file
 Turn on view state monitoring – any changes in control will be
tracked by View State for future.
Page Life Cycle - Events
 PreLoad()
 Load view state data for page and controls
 Load Postback data if needed
 We can process any kind operation that need to perform
before page load
 Load()
 OnLoad methods control called for each and every control
 We can create the connection initialization for any kind of
external source like database connection
 We can also set the control properties
Page Life Cycle - Events
 Control Events
 If this is an postback request , Corresponding events will triggered.
Like, if the post back is happing for button click, then Button_Click
Event will fired.
 PreRender
 Each control of the page has a PreRender event which is being
invoked.
 EnsureChildControls is also being called during this events
 DataBind method for all control has also been called
 If we want to change any thing to any control this is the last event
where we can do because after the pageRender starts
Page Life Cycle - Events
 SaveViewState
 ViewState Monitoring is turned off as here all the ViewState
Data need to be saved.
 View State data saved in hidden filed called _VIEWSTATE
 Render
 Pages calls the Render method for each and every control.
 Text writer that writes the output to the as output stream
 Output steam set to the page's Response property.
Page Life Cycle - Events
 Unload
 This is the last event of asp.net page life cycle
 This ensure the Request and Response has been set to null.
 This is called only after the content of the page fully rendered
and response sent to client
Page Life Cycle - Master Page and User Controls
 MasterPage gets initialized from the Page class in the init phaze
of page. The content of Masterpage gets loaded side by side as
the page gets loaded.
 User control will be initialized and added to the page and before
page gets initialized
 After page Onload, MasterPage_OnLoad gets called and
UserControl_Onload gets called sequentially.
 Followed by each of Page events, masterPage events gets called
and next Usercontrol events are called.
 During the unload phaze, Usercontrol gets unloaded first and
then masterpage and Page in sequence.
 For further reference refer to :
http://blogs.thesitedoctor.co.uk/tim/2006/06/30/Complete+Life
cycle+Of+An+ASPNet+Page+And+Controls.aspx
Q/A
Thank you

More Related Content

What's hot

Bootstrap
BootstrapBootstrap
Bootstrap
Jadson Santos
 
Introduction to java beans
Introduction to java beansIntroduction to java beans
Introduction to java beans
Hitesh Parmar
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
WebStackAcademy
 
Asp net
Asp netAsp net
Database programming
Database programmingDatabase programming
Asp.net state management
Asp.net state managementAsp.net state management
Asp.net state management
priya Nithya
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
BG Java EE Course
 
Php array
Php arrayPhp array
Php array
Nikul Shah
 
MULTI THREADING IN JAVA
MULTI THREADING IN JAVAMULTI THREADING IN JAVA
MULTI THREADING IN JAVA
VINOTH R
 
ASP.NET MVC.
ASP.NET MVC.ASP.NET MVC.
ASP.NET MVC.
Ni
 
Applets in java
Applets in javaApplets in java
Applets in java
Wani Zahoor
 
ASP.NET Lecture 1
ASP.NET Lecture 1ASP.NET Lecture 1
ASP.NET Lecture 1
Julie Iskander
 
Arrays in Java
Arrays in JavaArrays in Java
Arrays in Java
Naz Abdalla
 
Advance Java Topics (J2EE)
Advance Java Topics (J2EE)Advance Java Topics (J2EE)
Advance Java Topics (J2EE)
slire
 

What's hot (20)

Bootstrap
BootstrapBootstrap
Bootstrap
 
Introduction to java beans
Introduction to java beansIntroduction to java beans
Introduction to java beans
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
 
Asp net
Asp netAsp net
Asp net
 
Database programming
Database programmingDatabase programming
Database programming
 
Asp.net state management
Asp.net state managementAsp.net state management
Asp.net state management
 
php
phpphp
php
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
 
Php array
Php arrayPhp array
Php array
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
Model View Controller (MVC)
Model View Controller (MVC)Model View Controller (MVC)
Model View Controller (MVC)
 
MULTI THREADING IN JAVA
MULTI THREADING IN JAVAMULTI THREADING IN JAVA
MULTI THREADING IN JAVA
 
Ch 7 data binding
Ch 7 data bindingCh 7 data binding
Ch 7 data binding
 
ASP.NET MVC.
ASP.NET MVC.ASP.NET MVC.
ASP.NET MVC.
 
Applets in java
Applets in javaApplets in java
Applets in java
 
ASP.NET Lecture 1
ASP.NET Lecture 1ASP.NET Lecture 1
ASP.NET Lecture 1
 
Arrays in Java
Arrays in JavaArrays in Java
Arrays in Java
 
Web forms in ASP.net
Web forms in ASP.netWeb forms in ASP.net
Web forms in ASP.net
 
Php Presentation
Php PresentationPhp Presentation
Php Presentation
 
Advance Java Topics (J2EE)
Advance Java Topics (J2EE)Advance Java Topics (J2EE)
Advance Java Topics (J2EE)
 

Similar to ASP.NET Page Life Cycle

Aspnetpagelifecycle 101129103702-phpapp02
Aspnetpagelifecycle 101129103702-phpapp02Aspnetpagelifecycle 101129103702-phpapp02
Aspnetpagelifecycle 101129103702-phpapp02santoshkjogalekar
 
Parallelminds.asp.net with sp
Parallelminds.asp.net with spParallelminds.asp.net with sp
Parallelminds.asp.net with sp
parallelminder
 
Asp.net life cycle
Asp.net life cycleAsp.net life cycle
Asp.net life cycle
Irfaan Khan
 
Asp.net control
Asp.net controlAsp.net control
Asp.net control
Paneliya Prince
 
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
 
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
 
Aspnet life cycle events
Aspnet life cycle eventsAspnet life cycle events
Aspnet life cycle eventsTrushant parkar
 
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 life cycle in depth
Asp.net life cycle in depthAsp.net life cycle in depth
Asp.net life cycle in depth
sonia merchant
 
Asp.net page lifecycle
Asp.net page lifecycleAsp.net page lifecycle
Asp.net page lifecycle
KhademulBasher
 
Life cycle of web page
Life cycle of web pageLife cycle of web page
Life cycle of web page
university of Gujrat, pakistan
 
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
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
Peter Gfader
 
Dev Basics: The ASP.NET Page Life Cycle
Dev Basics: The ASP.NET Page Life CycleDev Basics: The ASP.NET Page Life Cycle
Dev Basics: The ASP.NET Page Life Cycle
Jay Harris
 
NET_Training.pptx
NET_Training.pptxNET_Training.pptx
NET_Training.pptx
ssuserc28c7c1
 
ASP.Net Presentation Part1
ASP.Net Presentation Part1ASP.Net Presentation Part1
ASP.Net Presentation Part1Neeraj Mathur
 
Web controls
Web controlsWeb controls
Web controls
Sarthak Varshney
 
As pnet pagelife_usha
As pnet pagelife_ushaAs pnet pagelife_usha
As pnet pagelife_usha
Rajalaxmi Pattanaik
 

Similar to ASP.NET Page Life Cycle (20)

Aspnetpagelifecycle 101129103702-phpapp02
Aspnetpagelifecycle 101129103702-phpapp02Aspnetpagelifecycle 101129103702-phpapp02
Aspnetpagelifecycle 101129103702-phpapp02
 
Parallelminds.asp.net with sp
Parallelminds.asp.net with spParallelminds.asp.net with sp
Parallelminds.asp.net with sp
 
Asp.net life cycle
Asp.net life cycleAsp.net life cycle
Asp.net life cycle
 
Asp.net control
Asp.net controlAsp.net control
Asp.net control
 
Asp dot net lifecycle in details
Asp dot net lifecycle in detailsAsp dot net lifecycle in details
Asp dot net lifecycle in details
 
Why ASP.NET Development is Important?
Why ASP.NET Development is Important?Why ASP.NET Development is Important?
Why ASP.NET Development is Important?
 
Aspnet life cycle events
Aspnet life cycle eventsAspnet life cycle events
Aspnet life cycle events
 
Page life cycle IN ASP.NET
Page life cycle IN ASP.NETPage life cycle IN ASP.NET
Page life cycle IN ASP.NET
 
Asp.net life cycle in depth
Asp.net life cycle in depthAsp.net life cycle in depth
Asp.net life cycle in depth
 
Asp.net page lifecycle
Asp.net page lifecycleAsp.net page lifecycle
Asp.net page lifecycle
 
Life cycle of web page
Life cycle of web pageLife cycle of web page
Life cycle of web page
 
Server Controls of ASP.Net
Server Controls of ASP.NetServer Controls of ASP.Net
Server Controls of ASP.Net
 
ASP.NET Page Life Cycle
ASP.NET Page Life CycleASP.NET Page Life Cycle
ASP.NET Page Life Cycle
 
Page life cycle
Page life cyclePage life cycle
Page life cycle
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
 
Dev Basics: The ASP.NET Page Life Cycle
Dev Basics: The ASP.NET Page Life CycleDev Basics: The ASP.NET Page Life Cycle
Dev Basics: The ASP.NET Page Life Cycle
 
NET_Training.pptx
NET_Training.pptxNET_Training.pptx
NET_Training.pptx
 
ASP.Net Presentation Part1
ASP.Net Presentation Part1ASP.Net Presentation Part1
ASP.Net Presentation Part1
 
Web controls
Web controlsWeb controls
Web controls
 
As pnet pagelife_usha
As pnet pagelife_ushaAs pnet pagelife_usha
As pnet pagelife_usha
 

More from Abhishek Sur

Azure servicefabric
Azure servicefabricAzure servicefabric
Azure servicefabric
Abhishek Sur
 
Building a bot with an intent
Building a bot with an intentBuilding a bot with an intent
Building a bot with an intent
Abhishek Sur
 
Code review
Code reviewCode review
Code review
Abhishek Sur
 
C# 7.0 Hacks and Features
C# 7.0 Hacks and FeaturesC# 7.0 Hacks and Features
C# 7.0 Hacks and Features
Abhishek Sur
 
Angular JS, A dive to concepts
Angular JS, A dive to conceptsAngular JS, A dive to concepts
Angular JS, A dive to concepts
Abhishek Sur
 
Stream Analytics Service in Azure
Stream Analytics Service in AzureStream Analytics Service in Azure
Stream Analytics Service in Azure
Abhishek Sur
 
Designing azure compute and storage infrastructure
Designing azure compute and storage infrastructureDesigning azure compute and storage infrastructure
Designing azure compute and storage infrastructure
Abhishek Sur
 
Working with Azure Resource Manager Templates
Working with Azure Resource Manager TemplatesWorking with Azure Resource Manager Templates
Working with Azure Resource Manager Templates
Abhishek Sur
 
F12 debugging in Ms edge
F12 debugging in Ms edgeF12 debugging in Ms edge
F12 debugging in Ms edge
Abhishek Sur
 
Mobile Services for Windows Azure
Mobile Services for Windows AzureMobile Services for Windows Azure
Mobile Services for Windows Azure
Abhishek Sur
 
Service bus to build Bridges
Service bus to build BridgesService bus to build Bridges
Service bus to build Bridges
Abhishek Sur
 
Windows azure pack overview
Windows azure pack overviewWindows azure pack overview
Windows azure pack overview
Abhishek Sur
 
AMicrosoft azure hyper v recovery manager overview
AMicrosoft azure hyper v recovery manager overviewAMicrosoft azure hyper v recovery manager overview
AMicrosoft azure hyper v recovery manager overview
Abhishek Sur
 
Di api di server b1 ws
Di api di server b1 wsDi api di server b1 ws
Di api di server b1 ws
Abhishek Sur
 
Integrating cortana with wp8 app
Integrating cortana with wp8 appIntegrating cortana with wp8 app
Integrating cortana with wp8 app
Abhishek Sur
 
Asp.net performance
Asp.net performanceAsp.net performance
Asp.net performanceAbhishek Sur
 
Introduction to XAML and its features
Introduction to XAML and its featuresIntroduction to XAML and its features
Introduction to XAML and its featuresAbhishek Sur
 
SQL Server2012 Enhancements
SQL Server2012 EnhancementsSQL Server2012 Enhancements
SQL Server2012 Enhancements
Abhishek Sur
 
Dev days Visual Studio 2012 Enhancements
Dev days Visual Studio 2012 EnhancementsDev days Visual Studio 2012 Enhancements
Dev days Visual Studio 2012 Enhancements
Abhishek Sur
 
Hidden Facts of .NET Language Gems
Hidden Facts of .NET Language GemsHidden Facts of .NET Language Gems
Hidden Facts of .NET Language Gems
Abhishek Sur
 

More from Abhishek Sur (20)

Azure servicefabric
Azure servicefabricAzure servicefabric
Azure servicefabric
 
Building a bot with an intent
Building a bot with an intentBuilding a bot with an intent
Building a bot with an intent
 
Code review
Code reviewCode review
Code review
 
C# 7.0 Hacks and Features
C# 7.0 Hacks and FeaturesC# 7.0 Hacks and Features
C# 7.0 Hacks and Features
 
Angular JS, A dive to concepts
Angular JS, A dive to conceptsAngular JS, A dive to concepts
Angular JS, A dive to concepts
 
Stream Analytics Service in Azure
Stream Analytics Service in AzureStream Analytics Service in Azure
Stream Analytics Service in Azure
 
Designing azure compute and storage infrastructure
Designing azure compute and storage infrastructureDesigning azure compute and storage infrastructure
Designing azure compute and storage infrastructure
 
Working with Azure Resource Manager Templates
Working with Azure Resource Manager TemplatesWorking with Azure Resource Manager Templates
Working with Azure Resource Manager Templates
 
F12 debugging in Ms edge
F12 debugging in Ms edgeF12 debugging in Ms edge
F12 debugging in Ms edge
 
Mobile Services for Windows Azure
Mobile Services for Windows AzureMobile Services for Windows Azure
Mobile Services for Windows Azure
 
Service bus to build Bridges
Service bus to build BridgesService bus to build Bridges
Service bus to build Bridges
 
Windows azure pack overview
Windows azure pack overviewWindows azure pack overview
Windows azure pack overview
 
AMicrosoft azure hyper v recovery manager overview
AMicrosoft azure hyper v recovery manager overviewAMicrosoft azure hyper v recovery manager overview
AMicrosoft azure hyper v recovery manager overview
 
Di api di server b1 ws
Di api di server b1 wsDi api di server b1 ws
Di api di server b1 ws
 
Integrating cortana with wp8 app
Integrating cortana with wp8 appIntegrating cortana with wp8 app
Integrating cortana with wp8 app
 
Asp.net performance
Asp.net performanceAsp.net performance
Asp.net performance
 
Introduction to XAML and its features
Introduction to XAML and its featuresIntroduction to XAML and its features
Introduction to XAML and its features
 
SQL Server2012 Enhancements
SQL Server2012 EnhancementsSQL Server2012 Enhancements
SQL Server2012 Enhancements
 
Dev days Visual Studio 2012 Enhancements
Dev days Visual Studio 2012 EnhancementsDev days Visual Studio 2012 Enhancements
Dev days Visual Studio 2012 Enhancements
 
Hidden Facts of .NET Language Gems
Hidden Facts of .NET Language GemsHidden Facts of .NET Language Gems
Hidden Facts of .NET Language Gems
 

Recently uploaded

Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 

Recently uploaded (20)

Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 

ASP.NET Page Life Cycle

  • 1. Presented By : Abhishek Sur http://www.abhisheksur.com/
  • 2. Table of Content  Introduction  Application Life Cycle  IIS Request Process  Application Pool  Worker Process  HTTP Handler/Module  ASP.NET Page Life Cycle  Page Life Cycle Steps  Page Life Cycle Events  Life Cycle for Master Page and User Control  QA
  • 3. Introduction  When Clients request for an aspx page from browser and lot of stuffs happens in background to produce the output or sending response to client. This evolves ASP.NET Page Lifecycle.  ASP.NET Page Life Cycle is very much important to know for each and every developer to developed an ASP.NET Web Application.  All events, data processing, dynamic control creation, view state, postback, rendering etc. are depends with Page Life Cycle.
  • 4. Application Life Cycle 1. Client Request For Information 2. Request comes to Server 3. Server Process the request 4. Send the response back to Client
  • 5. Application Life Cycle - Contd.  Key terms to remember  HTTP.SYS  WAS  Application Pool  Worker Process http://blogs.thesitedoctor.co.uk/tim/2006/06/30/Complete+Lifecycle+Of+A n+ASPNet+Page+And+Controls.aspx
  • 6. Application Life Cycle – Contd.  Key Terms To Remember  Http Module  Http Handler  Http Pipeline
  • 7. End Of Application Life Cycle – Start Page Life Cycle  Request Passes Through HTTP Pipe Line  This Start Page Life Cycle
  • 8. ASP.NET Page Life Cycle Begins  Start  Initialization  Load  Validation  Events  Render S I L VER
  • 9. Page Life Cycle - Start  Client Request For Resource  Request Comes To Server (IIS)  IIS Process the Initial Processing  Request Passed through HTTP- Pipe Line  ASP.NET Page Life Cycle Starts
  • 10. Page Life Cycle - Initialization  Set Postback properties  Unique ID for Each Control in the Page  Themes needs to be initialized  Dynamic control need to be created
  • 11. Page Life Cycle - Load  If the Request is the post back request then it loads data from View States and Control State
  • 12. Page Life Cycle - Validation  Validate the pages Control  Updates the IsValid property
  • 13. Page Life Cycle - Events  This will only fired if the request is an postback event.  Like, if the post back is happened for an Button Click. Button Click event will fired.
  • 14. Page Life Cycle - Render  Before Rendering All View State data has been set.  Render() method for all control has been called and write the out put on output stream.
  • 15. Page Life Cycle - Events http://msdn.microsoft.com/en-us/library/ms178472.aspx
  • 16. ASP.NET Page Life Cycle Events  PreInit  Init  PreLoad  Load  Control Events  PreRender  SaveViewState  Render  Unload
  • 17. Page Life Cycle – Events  PreInit()  This is the first event which raised in asp.net page lifecycle  Check for Request is for Post Back or not.  All dynamic control need to be created  Theme Change, Master Page Set at runtime  Init()  Raised after all controls have been initialized  Build up a tree of controls from the ASPX file  Turn on view state monitoring – any changes in control will be tracked by View State for future.
  • 18. Page Life Cycle - Events  PreLoad()  Load view state data for page and controls  Load Postback data if needed  We can process any kind operation that need to perform before page load  Load()  OnLoad methods control called for each and every control  We can create the connection initialization for any kind of external source like database connection  We can also set the control properties
  • 19. Page Life Cycle - Events  Control Events  If this is an postback request , Corresponding events will triggered. Like, if the post back is happing for button click, then Button_Click Event will fired.  PreRender  Each control of the page has a PreRender event which is being invoked.  EnsureChildControls is also being called during this events  DataBind method for all control has also been called  If we want to change any thing to any control this is the last event where we can do because after the pageRender starts
  • 20. Page Life Cycle - Events  SaveViewState  ViewState Monitoring is turned off as here all the ViewState Data need to be saved.  View State data saved in hidden filed called _VIEWSTATE  Render  Pages calls the Render method for each and every control.  Text writer that writes the output to the as output stream  Output steam set to the page's Response property.
  • 21. Page Life Cycle - Events  Unload  This is the last event of asp.net page life cycle  This ensure the Request and Response has been set to null.  This is called only after the content of the page fully rendered and response sent to client
  • 22. Page Life Cycle - Master Page and User Controls  MasterPage gets initialized from the Page class in the init phaze of page. The content of Masterpage gets loaded side by side as the page gets loaded.  User control will be initialized and added to the page and before page gets initialized  After page Onload, MasterPage_OnLoad gets called and UserControl_Onload gets called sequentially.  Followed by each of Page events, masterPage events gets called and next Usercontrol events are called.  During the unload phaze, Usercontrol gets unloaded first and then masterpage and Page in sequence.  For further reference refer to : http://blogs.thesitedoctor.co.uk/tim/2006/06/30/Complete+Life cycle+Of+An+ASPNet+Page+And+Controls.aspx
  • 23. Q/A