SlideShare a Scribd company logo
Page Life Cycle
Created By: Asim Hussain
Intro. Of Page Life Cycle
• When an ASP.NET page runs, the page goes through a life cycle in which it
performs a series of processing steps.
• These steps
• Initialization
• Instantiating Controls
• Restoring and Maintaining State
• Running Event Handler Code
• Rendering
Createdd By: Asim Hussain 2
• The following are the various stages or events of ASP.Net page life cycle.
1. Pre-Init
2. Init
3. Init Complete
4. Pre-Load
5. Load
6. Control
7. Load-Complete
8. Pre-Render
9. On Save State Complete
10. Render
11. Unload
Createdd By: Asim Hussain 3
1) Pre-Init Event
• There are four types of functionality we can perform in Pre-Init Event.
1. Check the IsPostBack property
2. Create or re-create dynamic controls
3. Set a master page dynamically
4. Set the Theme property dynamically
Createdd By: Asim Hussain 4
2) Init Event
• When all control set then we can use Init Events which include:
• Each control's UniqueID is set
• Any skin settings have been applied.
• The "Init" event is fired first for the bottom-most control in the hierarchy
• then fired up the hierarchy until it is fired for the page itself.
Createdd By: Asim Hussain 5
3) Init-Complete Event
• Until now the viewstate values are not yet loaded, hence you can use this
event to make changes to the view state that you want to ensure are persisted
after the next postback.
• Raised by the Page object.
• Use this event for processing tasks that require all initialization to be
complete.
Createdd By: Asim Hussain 6
4) Pre-Load Event
• Raised after the page loads view state for itself and all controls, and after it
processes postback data that is included with the Request instance.
• Before the Page instance raises this event, it loads view state for itself and all
controls, and then processes any postback data included with the Request
instance.
• Loads ViewState: ViewState data are loaded to controls.
• Loads Postback data: Postback data are now handed to the page controls.
Createdd By: Asim Hussain 7
5) Load Event
• The Page object calls the OnLoad method on the Page object, and then recursively
does the same for each child control until the page.
• This is the first place in the page lifecycle that all values are restored.
• Most code checks the value of IsPostBack to avoid unnecessarily resetting state.
• You may also call Validate and check the value of IsValid in this method.
• You can also create dynamic controls in this method.
• Use the OnLoad event method to set properties in controls and establish database
connections
Createdd By: Asim Hussain 8
6) Control Event
• ASP.NET now calls any events on the page or its controls that caused the
PostBack to occur.
• Use these events to handle specific control events, such as a Button control's Click
event or a TextBox control's TextChanged event.
• In a Postback request, if the page contains validator controls, check the IsValid
property of the Page and of individual validation controls before performing any
processing.
• This is just an example of a control event. Here it is the button click event that
caused the Postback.
Createdd By: Asim Hussain 9
7) Load Event
• Raised at the end of the event-handling stage.
• Use this event for tasks that require that all other controls on the page be
loaded
Createdd By: Asim Hussain 10
8) On-Render Event
• Raised after the Page object has created all controls that are required in order to render the page, including
child controls of composite controls.
• The Page object raises the PreRender event on the Page object, and then recursively does the same for each
child control
• The PreRender event of individual controls occurs after the PreRender event of the page.
• Allows final changes to the page or its control.
• This event takes place before saving ViewState, so any changes made here are saved.
• For example: After this event, you cannot change any property of a button or change any viewstate value.
• Each data bound control whose DataSourceID property is set calls its DataBind method.
• Use the event to make final changes to the contents of the page or its controls.
Createdd By: Asim Hussain 11
9) On Save State Complete
• Raised after view state and control state have been saved for the page and for
all controls.
• Before this event occurs, ViewState has been saved for the page and for all
controls.
• Any changes to the page or controls at this point will be ignored.
• Use this event perform tasks that require the view state to be saved, but that
do not make any changes to controls.
Createdd By: Asim Hussain 12
10) Render Method
• This is a method of the page object and its controls (and not an event).
• The Render method generates the client-side HTML, Dynamic Hypertext
Markup Language (DHTML), and script that are necessary to properly
display a control at the browser.
Createdd By: Asim Hussain 13
11) On-Load
• This event is used for cleanup code.
• At this point, all processing has occurred and it is safe to dispose of any remaining objects, including the Page object.
• Cleanup can be performed on:
• Instances of classes, in other words objects
• Closing opened files
• Closing database connections.
• This event occurs for each control and then for the page.
• During the unload stage, the page and its controls have been rendered, so you cannot make further changes to the response
stream.
• If you attempt to call a method such as the Response.Write method then the page will throw an exception.
Createdd By: Asim Hussain 14
THANK
YOU
Createdd By: Asim Hussain 15

More Related Content

Similar to Page life cycle

Aspnet life cycle events
Aspnet life cycle eventsAspnet life cycle events
Aspnet life cycle eventsTrushant parkar
 
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
 
Server Controls of ASP.Net
Server Controls of ASP.NetServer Controls of ASP.Net
Server Controls of ASP.Net
Hitesh Santani
 
ASP.NET - Life cycle of asp
ASP.NET - Life cycle of aspASP.NET - Life cycle of asp
ASP.NET - Life cycle of asp
priya Nithya
 
As pnet pagelife_usha
As pnet pagelife_ushaAs pnet pagelife_usha
As pnet pagelife_usha
Rajalaxmi Pattanaik
 
Asp.net control
Asp.net controlAsp.net control
Asp.net control
Paneliya Prince
 
Aspnet Life Cycles Events
Aspnet Life Cycles EventsAspnet Life Cycles Events
Aspnet Life Cycles Events
LiquidHub
 
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
 
Web controls
Web controlsWeb controls
Web controls
Sarthak Varshney
 
Page life cycle
Page life cyclePage life cycle
Page life cycle
anil4691
 
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
Mindfire Solutions
 
ASP.NET Session 6
ASP.NET Session 6ASP.NET Session 6
ASP.NET Session 6Sisir Ghosh
 
State management in asp
State management in aspState management in asp
State management in asp
Ibrahim MH
 
Autosys
AutosysAutosys
State management 1
State management 1State management 1
State management 1singhadarsh
 
Life cycle of web page
Life cycle of web pageLife cycle of web page
Life cycle of web page
university of Gujrat, pakistan
 

Similar to Page life cycle (20)

Aspnet life cycle events
Aspnet life cycle eventsAspnet life cycle events
Aspnet life cycle events
 
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
 
Server Controls of ASP.Net
Server Controls of ASP.NetServer Controls of ASP.Net
Server Controls of ASP.Net
 
ASP.NET - Life cycle of asp
ASP.NET - Life cycle of aspASP.NET - Life cycle of asp
ASP.NET - Life cycle of asp
 
As pnet pagelife_usha
As pnet pagelife_ushaAs pnet pagelife_usha
As pnet pagelife_usha
 
Asp.net control
Asp.net controlAsp.net control
Asp.net control
 
Aspnet Life Cycles Events
Aspnet Life Cycles EventsAspnet Life Cycles Events
Aspnet Life Cycles Events
 
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?
 
Web forms in ASP.net
Web forms in ASP.netWeb forms in ASP.net
Web forms in ASP.net
 
Web controls
Web controlsWeb controls
Web controls
 
Page life cycle
Page life cyclePage life cycle
Page life cycle
 
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
 
ASP.NET Session 6
ASP.NET Session 6ASP.NET Session 6
ASP.NET Session 6
 
State management in asp
State management in aspState management in asp
State management in asp
 
Autosys
AutosysAutosys
Autosys
 
State management 1
State management 1State management 1
State management 1
 
Life cycle of web page
Life cycle of web pageLife cycle of web page
Life cycle of web page
 

More from AsamHussain3

Case tool introduction
Case tool introductionCase tool introduction
Case tool introduction
AsamHussain3
 
Validation inputs and outputs
Validation inputs and outputsValidation inputs and outputs
Validation inputs and outputs
AsamHussain3
 
Software Testing and Quality
Software Testing and QualitySoftware Testing and Quality
Software Testing and Quality
AsamHussain3
 
Customers and Other Stakeholders
Customers and Other StakeholdersCustomers and Other Stakeholders
Customers and Other Stakeholders
AsamHussain3
 
Quality Management System
Quality Management SystemQuality Management System
Quality Management System
AsamHussain3
 
Methodologies for quality management
Methodologies for quality managementMethodologies for quality management
Methodologies for quality management
AsamHussain3
 

More from AsamHussain3 (6)

Case tool introduction
Case tool introductionCase tool introduction
Case tool introduction
 
Validation inputs and outputs
Validation inputs and outputsValidation inputs and outputs
Validation inputs and outputs
 
Software Testing and Quality
Software Testing and QualitySoftware Testing and Quality
Software Testing and Quality
 
Customers and Other Stakeholders
Customers and Other StakeholdersCustomers and Other Stakeholders
Customers and Other Stakeholders
 
Quality Management System
Quality Management SystemQuality Management System
Quality Management System
 
Methodologies for quality management
Methodologies for quality managementMethodologies for quality management
Methodologies for quality management
 

Recently uploaded

Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
Tier1 app
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Hivelance Technology
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
XfilesPro
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
Ortus Solutions, Corp
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
NaapbooksPrivateLimi
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
IES VE
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Anthony Dahanne
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
vrstrong314
 

Recently uploaded (20)

Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 

Page life cycle

  • 1. Page Life Cycle Created By: Asim Hussain
  • 2. Intro. Of Page Life Cycle • When an ASP.NET page runs, the page goes through a life cycle in which it performs a series of processing steps. • These steps • Initialization • Instantiating Controls • Restoring and Maintaining State • Running Event Handler Code • Rendering Createdd By: Asim Hussain 2
  • 3. • The following are the various stages or events of ASP.Net page life cycle. 1. Pre-Init 2. Init 3. Init Complete 4. Pre-Load 5. Load 6. Control 7. Load-Complete 8. Pre-Render 9. On Save State Complete 10. Render 11. Unload Createdd By: Asim Hussain 3
  • 4. 1) Pre-Init Event • There are four types of functionality we can perform in Pre-Init Event. 1. Check the IsPostBack property 2. Create or re-create dynamic controls 3. Set a master page dynamically 4. Set the Theme property dynamically Createdd By: Asim Hussain 4
  • 5. 2) Init Event • When all control set then we can use Init Events which include: • Each control's UniqueID is set • Any skin settings have been applied. • The "Init" event is fired first for the bottom-most control in the hierarchy • then fired up the hierarchy until it is fired for the page itself. Createdd By: Asim Hussain 5
  • 6. 3) Init-Complete Event • Until now the viewstate values are not yet loaded, hence you can use this event to make changes to the view state that you want to ensure are persisted after the next postback. • Raised by the Page object. • Use this event for processing tasks that require all initialization to be complete. Createdd By: Asim Hussain 6
  • 7. 4) Pre-Load Event • Raised after the page loads view state for itself and all controls, and after it processes postback data that is included with the Request instance. • Before the Page instance raises this event, it loads view state for itself and all controls, and then processes any postback data included with the Request instance. • Loads ViewState: ViewState data are loaded to controls. • Loads Postback data: Postback data are now handed to the page controls. Createdd By: Asim Hussain 7
  • 8. 5) Load Event • The Page object calls the OnLoad method on the Page object, and then recursively does the same for each child control until the page. • This is the first place in the page lifecycle that all values are restored. • Most code checks the value of IsPostBack to avoid unnecessarily resetting state. • You may also call Validate and check the value of IsValid in this method. • You can also create dynamic controls in this method. • Use the OnLoad event method to set properties in controls and establish database connections Createdd By: Asim Hussain 8
  • 9. 6) Control Event • ASP.NET now calls any events on the page or its controls that caused the PostBack to occur. • Use these events to handle specific control events, such as a Button control's Click event or a TextBox control's TextChanged event. • In a Postback request, if the page contains validator controls, check the IsValid property of the Page and of individual validation controls before performing any processing. • This is just an example of a control event. Here it is the button click event that caused the Postback. Createdd By: Asim Hussain 9
  • 10. 7) Load Event • Raised at the end of the event-handling stage. • Use this event for tasks that require that all other controls on the page be loaded Createdd By: Asim Hussain 10
  • 11. 8) On-Render Event • Raised after the Page object has created all controls that are required in order to render the page, including child controls of composite controls. • The Page object raises the PreRender event on the Page object, and then recursively does the same for each child control • The PreRender event of individual controls occurs after the PreRender event of the page. • Allows final changes to the page or its control. • This event takes place before saving ViewState, so any changes made here are saved. • For example: After this event, you cannot change any property of a button or change any viewstate value. • Each data bound control whose DataSourceID property is set calls its DataBind method. • Use the event to make final changes to the contents of the page or its controls. Createdd By: Asim Hussain 11
  • 12. 9) On Save State Complete • Raised after view state and control state have been saved for the page and for all controls. • Before this event occurs, ViewState has been saved for the page and for all controls. • Any changes to the page or controls at this point will be ignored. • Use this event perform tasks that require the view state to be saved, but that do not make any changes to controls. Createdd By: Asim Hussain 12
  • 13. 10) Render Method • This is a method of the page object and its controls (and not an event). • The Render method generates the client-side HTML, Dynamic Hypertext Markup Language (DHTML), and script that are necessary to properly display a control at the browser. Createdd By: Asim Hussain 13
  • 14. 11) On-Load • This event is used for cleanup code. • At this point, all processing has occurred and it is safe to dispose of any remaining objects, including the Page object. • Cleanup can be performed on: • Instances of classes, in other words objects • Closing opened files • Closing database connections. • This event occurs for each control and then for the page. • During the unload stage, the page and its controls have been rendered, so you cannot make further changes to the response stream. • If you attempt to call a method such as the Response.Write method then the page will throw an exception. Createdd By: Asim Hussain 14