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 (20)

Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
 
Asp net
Asp netAsp net
Asp net
 
jQuery for beginners
jQuery for beginnersjQuery for beginners
jQuery for beginners
 
Asp.net server controls
Asp.net server controlsAsp.net server controls
Asp.net server controls
 
Java Methods
Java MethodsJava Methods
Java Methods
 
ASP.NET Lecture 1
ASP.NET Lecture 1ASP.NET Lecture 1
ASP.NET Lecture 1
 
Lecture 1 introduction to vb.net
Lecture 1   introduction to vb.netLecture 1   introduction to vb.net
Lecture 1 introduction to vb.net
 
ADO .Net
ADO .Net ADO .Net
ADO .Net
 
Asp.net file types
Asp.net file typesAsp.net file types
Asp.net file types
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
4.C#
4.C#4.C#
4.C#
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
Bootstrap
BootstrapBootstrap
Bootstrap
 
Java awt (abstract window toolkit)
Java awt (abstract window toolkit)Java awt (abstract window toolkit)
Java awt (abstract window toolkit)
 
Methods in Java
Methods in JavaMethods in Java
Methods in Java
 
Asp.net.
Asp.net.Asp.net.
Asp.net.
 
Php Presentation
Php PresentationPhp Presentation
Php Presentation
 
Asp.Net Core MVC with Entity Framework
Asp.Net Core MVC with Entity FrameworkAsp.Net Core MVC with Entity Framework
Asp.Net Core MVC with Entity Framework
 
Exception handling in ASP .NET
Exception handling in ASP .NETException handling in ASP .NET
Exception handling in ASP .NET
 
JAVA AWT
JAVA AWTJAVA AWT
JAVA AWT
 

Similar to ASP.NET Page Life Cycle

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
 
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
 
Web forms in ASP.net
Web forms in ASP.netWeb forms in ASP.net
Web forms in 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
 
As pnet pagelife_usha
As pnet pagelife_ushaAs pnet pagelife_usha
As pnet pagelife_usha
 
ASP.NET Page life cycle and ViewState
ASP.NET Page life cycle and ViewStateASP.NET Page life cycle and ViewState
ASP.NET Page life cycle and ViewState
 

More from Abhishek Sur

Azure servicefabric
Azure servicefabricAzure servicefabric
Azure servicefabricAbhishek Sur
 
Building a bot with an intent
Building a bot with an intentBuilding a bot with an intent
Building a bot with an intentAbhishek Sur
 
C# 7.0 Hacks and Features
C# 7.0 Hacks and FeaturesC# 7.0 Hacks and Features
C# 7.0 Hacks and FeaturesAbhishek Sur
 
Angular JS, A dive to concepts
Angular JS, A dive to conceptsAngular JS, A dive to concepts
Angular JS, A dive to conceptsAbhishek Sur
 
Stream Analytics Service in Azure
Stream Analytics Service in AzureStream Analytics Service in Azure
Stream Analytics Service in AzureAbhishek Sur
 
Designing azure compute and storage infrastructure
Designing azure compute and storage infrastructureDesigning azure compute and storage infrastructure
Designing azure compute and storage infrastructureAbhishek Sur
 
Working with Azure Resource Manager Templates
Working with Azure Resource Manager TemplatesWorking with Azure Resource Manager Templates
Working with Azure Resource Manager TemplatesAbhishek Sur
 
F12 debugging in Ms edge
F12 debugging in Ms edgeF12 debugging in Ms edge
F12 debugging in Ms edgeAbhishek Sur
 
Mobile Services for Windows Azure
Mobile Services for Windows AzureMobile Services for Windows Azure
Mobile Services for Windows AzureAbhishek Sur
 
Service bus to build Bridges
Service bus to build BridgesService bus to build Bridges
Service bus to build BridgesAbhishek Sur
 
Windows azure pack overview
Windows azure pack overviewWindows azure pack overview
Windows azure pack overviewAbhishek 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 overviewAbhishek Sur
 
Di api di server b1 ws
Di api di server b1 wsDi api di server b1 ws
Di api di server b1 wsAbhishek Sur
 
Integrating cortana with wp8 app
Integrating cortana with wp8 appIntegrating cortana with wp8 app
Integrating cortana with wp8 appAbhishek 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 EnhancementsAbhishek Sur
 
Dev days Visual Studio 2012 Enhancements
Dev days Visual Studio 2012 EnhancementsDev days Visual Studio 2012 Enhancements
Dev days Visual Studio 2012 EnhancementsAbhishek Sur
 
Hidden Facts of .NET Language Gems
Hidden Facts of .NET Language GemsHidden Facts of .NET Language Gems
Hidden Facts of .NET Language GemsAbhishek 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

In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsExpeed Software
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka DoktorováCzechDreamin
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsStefano
 
Introduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationIntroduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationZilliz
 
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 2024Tobias Schneck
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaRTTS
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...CzechDreamin
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxAbida Shariff
 
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 FuturesBhaskar Mitra
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...Product School
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxDavid Michel
 
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
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaCzechDreamin
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024Stephanie Beckett
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...CzechDreamin
 
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 buttonDianaGray10
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2DianaGray10
 
The architecture of Generative AI for enterprises.pdf
The architecture of Generative AI for enterprises.pdfThe architecture of Generative AI for enterprises.pdf
The architecture of Generative AI for enterprises.pdfalexjohnson7307
 

Recently uploaded (20)

In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT Professionals
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
Introduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationIntroduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG Evaluation
 
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
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
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
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
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...
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
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
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
The architecture of Generative AI for enterprises.pdf
The architecture of Generative AI for enterprises.pdfThe architecture of Generative AI for enterprises.pdf
The architecture of Generative AI for enterprises.pdf
 

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