SlideShare a Scribd company logo
1 of 5
ASP.NETlife cycle specifies,how:
ASP.NETprocessespagestoproduce dynamicoutput
The applicationanditspagesare instantiatedandprocessed
ASP.NETcompilesthe pagesdynamically
The ASP.NETlife cycle couldbe dividedintotwogroups:
ApplicationLife Cycle
Page Life Cycle
ASP.NETApplicationLifeCycle
ASP.NET Page Life Cycle
Whena page isrequested,itisloadedintothe servermemory,processed,andsenttothe browser.
Thenit isunloadedfromthe memory.Ateachof these steps,methodsandeventsare available,which
couldbe overriddenaccordingtothe needof the application.Inotherwords,youcanwrite yourown
code to override the defaultcode.
The Page classcreatesa hierarchical tree of all the controlson the page.All the componentsonthe
page,exceptthe directives,are partof thiscontrol tree.You can see the control tree by addingtrace=
"true"to the page directive.We will coverpage directivesandtracingunder'directives'and'event
handling'.
The page life cycle phasesare:
Initialization
Instantiationof the controlsonthe page
Restorationandmaintenance of the state
Executionof the eventhandlercodes
Page rendering
Understandingthe page cycle helpsinwritingcodesformakingsome specificthinghappenatanystage
of the page life cycle.Italsohelpsinwritingcustomcontrolsandinitializingthematrighttime,populate
theirpropertieswithview-statedataandrun control behaviorcode.
Followingare the differentstagesof anASP.NETpage:
Page request - WhenASP.NETgetsa page request,itdecideswhethertoparse and
compile the page,orthere wouldbe a cachedversionof the page;accordinglythe response issent.
Starting of page life cycle - At thisstage,the RequestandResponse objectsare set.
If the requestisanoldrequestor postback, the IsPostBackpropertyof the page is setto true.The
UICulture propertyof the page isalso set.
Page initialization - At thisstage,the controls on the page are assigneduniqueIDby
settingthe UniqueIDpropertyandthe themesare applied.Foranew request,postbackdatais loaded
and the control propertiesare restoredtothe view-statevalues.
Page load - At thisstage,control propertiesare setusingthe view state andcontrol state
values.
Validation - Validate methodof the validationcontrol iscalledandonitssuccessful execution,
the IsValidpropertyof the page issetto true.
Postback event handling - If the requestisa postback (oldrequest),the related
eventhandlerisinvoked.
Page rendering - At thisstage,view state forthe page and all controlsare saved.The page
callsthe Rendermethodforeachcontrol and the outputof renderingiswrittentothe OutputStream
classof the Response propertyof page.
Unload - The renderedpage issenttothe clientandpage properties,suchasResponse and
Request,are unloadedandall cleanupdone.
ASP.NET Page Life Cycle Events
At eachstage of the page life cycle,the page raisessome events,whichcouldbe coded.Anevent
handlerisbasicallyafunctionorsubroutine,boundtothe event,usingdeclarative attributessuchas
Onclickor handle.
Followingare the page life cycle events:
PreInit- PreInitisthe firsteventinpage life cycle.Itchecksthe IsPostBackpropertyanddetermines
whetherthe page isa postback.It setsthe themesandmasterpages,createsdynamiccontrols,andgets
and setsprofile propertyvalues.Thiseventcanbe handledbyoverloadingthe OnPreInitmethodor
creatinga Page_PreInithandler.
Init- Initeventinitializesthe control propertyandthe control tree isbuilt.Thiseventcanbe handledby
overloadingthe OnInitmethodorcreatingaPage_Inithandler.
InitComplete - InitComplete eventallowstrackingof view state.All the controlsturnonview-state
tracking.
LoadViewState- LoadViewState eventallowsloadingview state informationintothe controls.
LoadPostData- Duringthisphase,the contentsof all the inputfieldsare definedwiththe <form>tagare
processed.
PreLoad- PreLoadoccurs before the postbackdata is loadedinthe controls.Thiseventcanbe handled
by overloadingthe OnPreLoadmethodorcreatingaPage_PreLoadhandler.
Load - The Load eventisraisedforthe page firstandthenrecursivelyforall childcontrols.The controls
inthe control tree are created.Thiseventcan be handledbyoverloadingthe OnLoadmethodor
creatinga Page_Loadhandler.
LoadComplete - The loadingprocessiscompleted,control eventhandlersare run,andpage validation
takesplace.Thiseventcanbe handledbyoverloadingthe OnLoadComplete methodorcreatinga
Page_LoadComplete handler
PreRender- The PreRendereventoccursjustbefore the outputisrendered.Byhandlingthisevent,
pagesand controlscan performanyupdatesbefore the outputisrendered.
PreRenderComplete- Asthe PreRendereventisrecursivelyfiredforall childcontrols,thiseventensures
the completionof the pre-renderingphase.
SaveStateComplete - State of control onthe page issaved.Personalization,control state andview state
informationissaved.The HTML markupis generated.Thisstage canbe handledbyoverridingthe
Rendermethodorcreatinga Page_Renderhandler.
UnLoad - The UnLoad phase is the lastphase of the page life cycle.Itraisesthe UnLoad eventforall
controlsrecursivelyandlastlyforthe page itself.Final cleanupisdone andall resourcesandreferences,
such as database connections,are freed.Thiseventcanbe handledbymodifyingthe OnUnLoadmethod
or creatinga Page_UnLoad handler.

More Related Content

What's hot

Aspnet Life Cycles Events
Aspnet Life Cycles EventsAspnet Life Cycles Events
Aspnet Life Cycles EventsLiquidHub
 
Asp.net event handler
Asp.net event handlerAsp.net event handler
Asp.net event handlerSireesh K
 
Writing a massive javascript app
Writing a massive javascript appWriting a massive javascript app
Writing a massive javascript appJustin Park
 
Asp dot net lifecycle in details
Asp dot net lifecycle in detailsAsp dot net lifecycle in details
Asp dot net lifecycle in detailsAyesha Khan
 
ASP.NET Page Life Cycle
ASP.NET Page Life CycleASP.NET Page Life Cycle
ASP.NET Page Life CycleAbhishek Sur
 
multiple views and routing
multiple views and routingmultiple views and routing
multiple views and routingBrajesh Yadav
 
Creating EPiServer Usage Reports
Creating EPiServer Usage ReportsCreating EPiServer Usage Reports
Creating EPiServer Usage ReportsPaul Graham
 
React js t7 - forms-events
React js   t7 - forms-eventsReact js   t7 - forms-events
React js t7 - forms-eventsJainul Musani
 
Asp.net state management
Asp.net state managementAsp.net state management
Asp.net state managementpriya Nithya
 
Ajax pagination using j query in rails3
Ajax pagination using j query in rails3Ajax pagination using j query in rails3
Ajax pagination using j query in rails3Andolasoft Inc
 
Page life cycle
Page life cyclePage life cycle
Page life cycleanil4691
 
React js t8 - inlinecss
React js   t8 - inlinecssReact js   t8 - inlinecss
React js t8 - inlinecssJainul Musani
 
Troubleshooting oracle apps
Troubleshooting oracle appsTroubleshooting oracle apps
Troubleshooting oracle appsvamsi18here
 
Indic threads pune12-improve testing efficiency with selenium webdriver
Indic threads pune12-improve testing efficiency with selenium webdriverIndic threads pune12-improve testing efficiency with selenium webdriver
Indic threads pune12-improve testing efficiency with selenium webdriverIndicThreads
 

What's hot (16)

Aspnet Life Cycles Events
Aspnet Life Cycles EventsAspnet Life Cycles Events
Aspnet Life Cycles Events
 
Asp.net event handler
Asp.net event handlerAsp.net event handler
Asp.net event handler
 
Writing a massive javascript app
Writing a massive javascript appWriting a massive javascript app
Writing a massive javascript app
 
Asp dot net lifecycle in details
Asp dot net lifecycle in detailsAsp dot net lifecycle in details
Asp dot net lifecycle in details
 
ASP.NET Page Life Cycle
ASP.NET Page Life CycleASP.NET Page Life Cycle
ASP.NET Page Life Cycle
 
multiple views and routing
multiple views and routingmultiple views and routing
multiple views and routing
 
Creating EPiServer Usage Reports
Creating EPiServer Usage ReportsCreating EPiServer Usage Reports
Creating EPiServer Usage Reports
 
React js t7 - forms-events
React js   t7 - forms-eventsReact js   t7 - forms-events
React js t7 - forms-events
 
Asp.net state management
Asp.net state managementAsp.net state management
Asp.net state management
 
Ajax pagination using j query in rails3
Ajax pagination using j query in rails3Ajax pagination using j query in rails3
Ajax pagination using j query in rails3
 
Page life cycle
Page life cyclePage life cycle
Page life cycle
 
React js t8 - inlinecss
React js   t8 - inlinecssReact js   t8 - inlinecss
React js t8 - inlinecss
 
Troubleshooting oracle apps
Troubleshooting oracle appsTroubleshooting oracle apps
Troubleshooting oracle apps
 
07 02-05
07 02-0507 02-05
07 02-05
 
Indic threads pune12-improve testing efficiency with selenium webdriver
Indic threads pune12-improve testing efficiency with selenium webdriverIndic threads pune12-improve testing efficiency with selenium webdriver
Indic threads pune12-improve testing efficiency with selenium webdriver
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 

Similar to Life cycle of web page

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
 
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 spparallelminder
 
Aspnet life cycle events
Aspnet life cycle eventsAspnet life cycle events
Aspnet life cycle eventsTrushant parkar
 
13 asp.net session19
13 asp.net session1913 asp.net session19
13 asp.net session19Vivek chan
 
C sharp and asp.net interview questions
C sharp and asp.net interview questionsC sharp and asp.net interview questions
C sharp and asp.net interview questionsAkhil Mittal
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NETPeter Gfader
 
ASP.Net Presentation Part1
ASP.Net Presentation Part1ASP.Net Presentation Part1
ASP.Net Presentation Part1Neeraj Mathur
 
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 CycleJay Harris
 
Overview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company indiaOverview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company indiaJignesh Aakoliya
 
ASP.NET 02 - How ASP.NET Works
ASP.NET 02 - How ASP.NET WorksASP.NET 02 - How ASP.NET Works
ASP.NET 02 - How ASP.NET WorksRandy Connolly
 
Server Controls of ASP.Net
Server Controls of ASP.NetServer Controls of ASP.Net
Server Controls of ASP.NetHitesh Santani
 
03 asp.net session04
03 asp.net session0403 asp.net session04
03 asp.net session04Vivek chan
 

Similar to Life cycle of web page (20)

Why ASP.NET Development is Important?
Why ASP.NET Development is Important?Why ASP.NET Development is Important?
Why ASP.NET Development is Important?
 
Aspnetpagelifecycle 101129103702-phpapp02
Aspnetpagelifecycle 101129103702-phpapp02Aspnetpagelifecycle 101129103702-phpapp02
Aspnetpagelifecycle 101129103702-phpapp02
 
Asp.net control
Asp.net controlAsp.net control
Asp.net control
 
Parallelminds.asp.net with sp
Parallelminds.asp.net with spParallelminds.asp.net with sp
Parallelminds.asp.net with sp
 
Aspnet life cycle events
Aspnet life cycle eventsAspnet life cycle events
Aspnet life cycle events
 
13 asp.net session19
13 asp.net session1913 asp.net session19
13 asp.net session19
 
C sharp and asp.net interview questions
C sharp and asp.net interview questionsC sharp and asp.net interview questions
C sharp and asp.net interview questions
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
 
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
 
Ajax and ASP.NET AJAX
Ajax and ASP.NET AJAXAjax and ASP.NET AJAX
Ajax and ASP.NET AJAX
 
Web controls
Web controlsWeb controls
Web controls
 
NET_Training.pptx
NET_Training.pptxNET_Training.pptx
NET_Training.pptx
 
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
 
Web forms in ASP.net
Web forms in ASP.netWeb forms in ASP.net
Web forms in ASP.net
 
Overview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company indiaOverview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company india
 
ASP.NET 02 - How ASP.NET Works
ASP.NET 02 - How ASP.NET WorksASP.NET 02 - How ASP.NET Works
ASP.NET 02 - How ASP.NET Works
 
Server Controls of ASP.Net
Server Controls of ASP.NetServer Controls of ASP.Net
Server Controls of ASP.Net
 
ASP.NET Lecture 2
ASP.NET Lecture 2ASP.NET Lecture 2
ASP.NET Lecture 2
 
03 asp.net session04
03 asp.net session0403 asp.net session04
03 asp.net session04
 

More from university of Gujrat, pakistan

More from university of Gujrat, pakistan (20)

Change management
Change management Change management
Change management
 
Latest Trends in Digital Marketing
Latest Trends in Digital MarketingLatest Trends in Digital Marketing
Latest Trends in Digital Marketing
 
Dark web (2)
Dark web (2)Dark web (2)
Dark web (2)
 
Code of ethics and professional conduct (1)
Code of ethics and professional conduct (1)Code of ethics and professional conduct (1)
Code of ethics and professional conduct (1)
 
Certification accreditation and licensure (1)
Certification accreditation and licensure (1)Certification accreditation and licensure (1)
Certification accreditation and licensure (1)
 
biggest technology trends
biggest technology trendsbiggest technology trends
biggest technology trends
 
Freedom of information (1)
Freedom of information (1)Freedom of information (1)
Freedom of information (1)
 
Individual cognition ppt (1)
Individual cognition ppt (1)Individual cognition ppt (1)
Individual cognition ppt (1)
 
Top 10 highest (1)
Top 10 highest (1)Top 10 highest (1)
Top 10 highest (1)
 
creativity and imagination
creativity and imagination creativity and imagination
creativity and imagination
 
Brainstorming 078 (1)
Brainstorming 078 (1)Brainstorming 078 (1)
Brainstorming 078 (1)
 
speeh-artificial intelligemce
speeh-artificial intelligemce speeh-artificial intelligemce
speeh-artificial intelligemce
 
Pp dealing with problem complexity (1)
Pp dealing with problem complexity (1)Pp dealing with problem complexity (1)
Pp dealing with problem complexity (1)
 
Motivation
MotivationMotivation
Motivation
 
Vision of artificial intelligence (1)
Vision of artificial intelligence (1)Vision of artificial intelligence (1)
Vision of artificial intelligence (1)
 
Entrepreneurship (1)
Entrepreneurship (1)Entrepreneurship (1)
Entrepreneurship (1)
 
Role of professional societies
Role of professional societiesRole of professional societies
Role of professional societies
 
Dealing with culticultural environment (1)
Dealing with culticultural environment (1)Dealing with culticultural environment (1)
Dealing with culticultural environment (1)
 
Dealing with problem complexity (1)
Dealing with problem complexity (1)Dealing with problem complexity (1)
Dealing with problem complexity (1)
 
cyber security and cyber crime
cyber security and cyber crime cyber security and cyber crime
cyber security and cyber crime
 

Recently uploaded

Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxnada99848
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 

Recently uploaded (20)

Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptx
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 

Life cycle of web page

  • 1. ASP.NETlife cycle specifies,how: ASP.NETprocessespagestoproduce dynamicoutput The applicationanditspagesare instantiatedandprocessed ASP.NETcompilesthe pagesdynamically The ASP.NETlife cycle couldbe dividedintotwogroups: ApplicationLife Cycle Page Life Cycle ASP.NETApplicationLifeCycle ASP.NET Page Life Cycle Whena page isrequested,itisloadedintothe servermemory,processed,andsenttothe browser. Thenit isunloadedfromthe memory.Ateachof these steps,methodsandeventsare available,which couldbe overriddenaccordingtothe needof the application.Inotherwords,youcanwrite yourown code to override the defaultcode.
  • 2. The Page classcreatesa hierarchical tree of all the controlson the page.All the componentsonthe page,exceptthe directives,are partof thiscontrol tree.You can see the control tree by addingtrace= "true"to the page directive.We will coverpage directivesandtracingunder'directives'and'event handling'. The page life cycle phasesare: Initialization Instantiationof the controlsonthe page Restorationandmaintenance of the state Executionof the eventhandlercodes Page rendering Understandingthe page cycle helpsinwritingcodesformakingsome specificthinghappenatanystage of the page life cycle.Italsohelpsinwritingcustomcontrolsandinitializingthematrighttime,populate theirpropertieswithview-statedataandrun control behaviorcode. Followingare the differentstagesof anASP.NETpage: Page request - WhenASP.NETgetsa page request,itdecideswhethertoparse and compile the page,orthere wouldbe a cachedversionof the page;accordinglythe response issent. Starting of page life cycle - At thisstage,the RequestandResponse objectsare set. If the requestisanoldrequestor postback, the IsPostBackpropertyof the page is setto true.The UICulture propertyof the page isalso set. Page initialization - At thisstage,the controls on the page are assigneduniqueIDby settingthe UniqueIDpropertyandthe themesare applied.Foranew request,postbackdatais loaded and the control propertiesare restoredtothe view-statevalues.
  • 3. Page load - At thisstage,control propertiesare setusingthe view state andcontrol state values. Validation - Validate methodof the validationcontrol iscalledandonitssuccessful execution, the IsValidpropertyof the page issetto true. Postback event handling - If the requestisa postback (oldrequest),the related eventhandlerisinvoked. Page rendering - At thisstage,view state forthe page and all controlsare saved.The page callsthe Rendermethodforeachcontrol and the outputof renderingiswrittentothe OutputStream classof the Response propertyof page. Unload - The renderedpage issenttothe clientandpage properties,suchasResponse and Request,are unloadedandall cleanupdone. ASP.NET Page Life Cycle Events At eachstage of the page life cycle,the page raisessome events,whichcouldbe coded.Anevent handlerisbasicallyafunctionorsubroutine,boundtothe event,usingdeclarative attributessuchas Onclickor handle. Followingare the page life cycle events: PreInit- PreInitisthe firsteventinpage life cycle.Itchecksthe IsPostBackpropertyanddetermines whetherthe page isa postback.It setsthe themesandmasterpages,createsdynamiccontrols,andgets and setsprofile propertyvalues.Thiseventcanbe handledbyoverloadingthe OnPreInitmethodor creatinga Page_PreInithandler.
  • 4. Init- Initeventinitializesthe control propertyandthe control tree isbuilt.Thiseventcanbe handledby overloadingthe OnInitmethodorcreatingaPage_Inithandler. InitComplete - InitComplete eventallowstrackingof view state.All the controlsturnonview-state tracking. LoadViewState- LoadViewState eventallowsloadingview state informationintothe controls. LoadPostData- Duringthisphase,the contentsof all the inputfieldsare definedwiththe <form>tagare processed. PreLoad- PreLoadoccurs before the postbackdata is loadedinthe controls.Thiseventcanbe handled by overloadingthe OnPreLoadmethodorcreatingaPage_PreLoadhandler. Load - The Load eventisraisedforthe page firstandthenrecursivelyforall childcontrols.The controls inthe control tree are created.Thiseventcan be handledbyoverloadingthe OnLoadmethodor creatinga Page_Loadhandler. LoadComplete - The loadingprocessiscompleted,control eventhandlersare run,andpage validation takesplace.Thiseventcanbe handledbyoverloadingthe OnLoadComplete methodorcreatinga Page_LoadComplete handler PreRender- The PreRendereventoccursjustbefore the outputisrendered.Byhandlingthisevent, pagesand controlscan performanyupdatesbefore the outputisrendered. PreRenderComplete- Asthe PreRendereventisrecursivelyfiredforall childcontrols,thiseventensures the completionof the pre-renderingphase. SaveStateComplete - State of control onthe page issaved.Personalization,control state andview state informationissaved.The HTML markupis generated.Thisstage canbe handledbyoverridingthe Rendermethodorcreatinga Page_Renderhandler.
  • 5. UnLoad - The UnLoad phase is the lastphase of the page life cycle.Itraisesthe UnLoad eventforall controlsrecursivelyandlastlyforthe page itself.Final cleanupisdone andall resourcesandreferences, such as database connections,are freed.Thiseventcanbe handledbymodifyingthe OnUnLoadmethod or creatinga Page_UnLoad handler.