asp.net page life cycle
TRANSCRIPT
![Page 1: ASP.NET Page Life Cycle](https://reader035.vdocument.in/reader035/viewer/2022062512/55498007b4c905c26a8b4750/html5/thumbnails/1.jpg)
![Page 2: ASP.NET Page Life Cycle](https://reader035.vdocument.in/reader035/viewer/2022062512/55498007b4c905c26a8b4750/html5/thumbnails/2.jpg)
Disclaimer: This presentation is prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra –Mentoring PartnerBaabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd
![Page 3: ASP.NET Page Life Cycle](https://reader035.vdocument.in/reader035/viewer/2022062512/55498007b4c905c26a8b4750/html5/thumbnails/3.jpg)
Week Target Achieved
1 30 22
2 30 23
3 30 25
Typing Speed
![Page 4: ASP.NET Page Life Cycle](https://reader035.vdocument.in/reader035/viewer/2022062512/55498007b4c905c26a8b4750/html5/thumbnails/4.jpg)
Jobs AppliedWeek Company Designation Applied Date Current Status
1
2
3
![Page 5: ASP.NET Page Life Cycle](https://reader035.vdocument.in/reader035/viewer/2022062512/55498007b4c905c26a8b4750/html5/thumbnails/5.jpg)
ASP .Net Page Life Cycle
Muhammed [email protected]/usernametwitter.com/usernamein.linkedin.com/in/profilename9745020951
![Page 6: ASP.NET Page Life Cycle](https://reader035.vdocument.in/reader035/viewer/2022062512/55498007b4c905c26a8b4750/html5/thumbnails/6.jpg)
Overview
• Introduction• General stages• Events
![Page 7: ASP.NET Page Life Cycle](https://reader035.vdocument.in/reader035/viewer/2022062512/55498007b4c905c26a8b4750/html5/thumbnails/7.jpg)
Introduction
When a web page is requested to the web server, it goes through a series of sequence of steps before it is returned back to the web browser.
1. Web Application creates an instance of the requested web form.
2. Processes the events of the web form.
3. Generates the HTML, and sends the HTML back to the requested client.
4. The web form gets destroyed and removed from the memory.
![Page 8: ASP.NET Page Life Cycle](https://reader035.vdocument.in/reader035/viewer/2022062512/55498007b4c905c26a8b4750/html5/thumbnails/8.jpg)
Genera Steps
• S = Start • I = Initialization • L = Load• V = Validate• E = Event Handlers• R = Render
![Page 9: ASP.NET Page Life Cycle](https://reader035.vdocument.in/reader035/viewer/2022062512/55498007b4c905c26a8b4750/html5/thumbnails/9.jpg)
Postback
• A Post Back is any request for a page that is not the first request.– Check post back using isPostback()
View state
• The view state store the page specific information when a page posted back to the server.
![Page 10: ASP.NET Page Life Cycle](https://reader035.vdocument.in/reader035/viewer/2022062512/55498007b4c905c26a8b4750/html5/thumbnails/10.jpg)
Page life cycle Events
![Page 11: ASP.NET Page Life Cycle](https://reader035.vdocument.in/reader035/viewer/2022062512/55498007b4c905c26a8b4750/html5/thumbnails/11.jpg)
PreInit
• Raised after the start stage is complete and before the initialization stage begins– set isPostBack property– Possible to change or set Master page, themes– Creates or recreates dynamic controls
![Page 12: ASP.NET Page Life Cycle](https://reader035.vdocument.in/reader035/viewer/2022062512/55498007b4c905c26a8b4750/html5/thumbnails/12.jpg)
Page_PreInit
![Page 13: ASP.NET Page Life Cycle](https://reader035.vdocument.in/reader035/viewer/2022062512/55498007b4c905c26a8b4750/html5/thumbnails/13.jpg)
Page_Init
• Raised after all controls have been initialized and any skin settings have been applied.
• The Page_Init event fires only the first time the page is loaded.
Init Complete•View state functionality is turned on for server control
![Page 14: ASP.NET Page Life Cycle](https://reader035.vdocument.in/reader035/viewer/2022062512/55498007b4c905c26a8b4750/html5/thumbnails/14.jpg)
PreLoad
•PreLoad executes after InitComplete method.
• page has loaded values from view state.
![Page 15: ASP.NET Page Life Cycle](https://reader035.vdocument.in/reader035/viewer/2022062512/55498007b4c905c26a8b4750/html5/thumbnails/15.jpg)
PreLoad
![Page 16: ASP.NET Page Life Cycle](https://reader035.vdocument.in/reader035/viewer/2022062512/55498007b4c905c26a8b4750/html5/thumbnails/16.jpg)
Load()• This event loads individual controls. • We can create the connection initialization for any kind of
external source like database connection• We can also set the control properties• We can created our own Load method
![Page 17: ASP.NET Page Life Cycle](https://reader035.vdocument.in/reader035/viewer/2022062512/55498007b4c905c26a8b4750/html5/thumbnails/17.jpg)
Control events
• Use these events to handle specific control events,• If this is an postback request , Corresponding events will
triggered.
![Page 18: ASP.NET Page Life Cycle](https://reader035.vdocument.in/reader035/viewer/2022062512/55498007b4c905c26a8b4750/html5/thumbnails/18.jpg)
• Control events
![Page 19: ASP.NET Page Life Cycle](https://reader035.vdocument.in/reader035/viewer/2022062512/55498007b4c905c26a8b4750/html5/thumbnails/19.jpg)
LoadComplete
• This event can be used when all the event processing has been done in the page.
![Page 20: ASP.NET Page Life Cycle](https://reader035.vdocument.in/reader035/viewer/2022062512/55498007b4c905c26a8b4750/html5/thumbnails/20.jpg)
PreRender
• Each control of the page has a PreRender event which is being invoked.
• 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 21: ASP.NET Page Life Cycle](https://reader035.vdocument.in/reader035/viewer/2022062512/55498007b4c905c26a8b4750/html5/thumbnails/21.jpg)
• 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
![Page 22: ASP.NET Page Life Cycle](https://reader035.vdocument.in/reader035/viewer/2022062512/55498007b4c905c26a8b4750/html5/thumbnails/22.jpg)
•RenderPages• 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 23: ASP.NET Page Life Cycle](https://reader035.vdocument.in/reader035/viewer/2022062512/55498007b4c905c26a8b4750/html5/thumbnails/23.jpg)
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 24: ASP.NET Page Life Cycle](https://reader035.vdocument.in/reader035/viewer/2022062512/55498007b4c905c26a8b4750/html5/thumbnails/24.jpg)
Order of execution
![Page 25: ASP.NET Page Life Cycle](https://reader035.vdocument.in/reader035/viewer/2022062512/55498007b4c905c26a8b4750/html5/thumbnails/25.jpg)
![Page 26: ASP.NET Page Life Cycle](https://reader035.vdocument.in/reader035/viewer/2022062512/55498007b4c905c26a8b4750/html5/thumbnails/26.jpg)
Thank you
![Page 27: ASP.NET Page Life Cycle](https://reader035.vdocument.in/reader035/viewer/2022062512/55498007b4c905c26a8b4750/html5/thumbnails/27.jpg)
If this presentation helped you, please visit our page facebook.com/baabtra and like it.
Thanks in advance.
www.baabtra.com | www.massbaab.com |www.baabte.com
![Page 28: ASP.NET Page Life Cycle](https://reader035.vdocument.in/reader035/viewer/2022062512/55498007b4c905c26a8b4750/html5/thumbnails/28.jpg)
Contact Us
Emarald Mall (Big Bazar Building)Mavoor Road, Kozhikode,Kerala, India.Ph: + 91 – 495 40 25 550
NC Complex, Near Bus StandMukkam, Kozhikode,Kerala, India.Ph: + 91 – 495 40 25 550
Start up VillageEranakulam,Kerala, India.
Email: [email protected]
IKK Road,East Hill, KozhikodeKerala, India.Ph: + 91 – 495 30 63 624
NIT-TBI,NIT Campus, Kozhikode,Kerala, India.