SlideShare uma empresa Scribd logo
1 de 22
Baixar para ler offline
Page Life
Cycle And
ViewState

Presenter: Vijay Goyal, Mindfire Solutions
Skype: mfsi_vijayg
Date: 30/09/2013
Agenda Of The Seminar
-

Pre Page Life Cyle (Asp.Net Inside IIS)
What on Earth is ViewState?
The different (Important) stages of Life Cycle
Where ViewState comes into the picture?
Dynamically created control
Deal with the burden of ViewState on the page
Some Demo...with some more Demo

Conferrer: Vijay Goyal, Mindfire Solutions
This is not an IIS course

Conferrer: Vijay Goyal, Mindfire Solutions
The Two Important Services

Conferrer: Vijay Goyal, Mindfire Solutions
The ProcessRequest()
- After all the registered
Modules are executed. The
page is ready to be served.
- For this IIS uses the
handler's mapping, to map
the request to the
appropriate handler.
- ProcessRequest() method is
executed and Page Life Cycle
begins

Conferrer: Vijay Goyal, Mindfire Solutions.
The Page Life Cycle Begins..

Conferrer: Vijay Goyal, Mindfire Solutions
Formation Of Control Heirarchy
- Request to an aspx page is served by a compiled
class

“C:WindowsMicrosoft.NETFrameworkv4.0.30319Temp
orary ASP.NET Files”
- Initializes the page's control hierarchy

Conferrer: Vijay Goyal, Mindfire Solutions
Formation Of Control Heirarchy

Conferrer: Vijay Goyal, Mindfire Solutions
But What's ViewState??
-

Its a misunderstood topic
An object of Statebag class
Stores changes done programatically
SelectedIndex / PageIndex not stored
A property of System.Web.UI.Controls
A key/value pair indexer.
Serialized to _VIEWSTATE hidden field
ViewState is a hungry beast.

Conferrer: Vijay Goyal, Mindfire Solutions
Initialization
- PreInit (Entry point, Non Recursive)
- Init (Tracking of Viewstate

is not enabled
/ Enabled for child controls, Recursive)

- InitComplete (Viewstate tracking
is turned on, Non Recursive)
- SaveViewState()
- Page.TrackViewState()
Conferrer: Vijay Goyal, Mindfire Solutions.
Load ViewState/Page Data
- Invoked only on Postbacks
- LoadControlState (Introduced in Asp.Net 2.0,
gridview page control, SaveControlState()l)

- LoadViewState
SaveViewState())

- LoadPostData

(Page and controls restored,

(Controls implement IpostBackDataHandler,

Selected value in dropdown, checkbox, Textbox)

Conferrer: Vijay Goyal, Mindfire Solutions.
Loading the Page...
- PreLoad (Non Recursive, End of Viewstate data load)
- Load (Top down approach, Previous State is fully loaded)
- RaisePostDataChangeEvent

(Controls implement
IpostBackDataHandler, TextChanged/SelectedIndexChanged)

- RaisePostBackEvent
click event)

- LoadComplete

(Controls implement IpostBackDataHandler,

(Page only)

Conferrer: Vijay Goyal, Mindfire Solutions
Page Rendering
- PreRender

(Recursive, Last update before the page is rendered)

- PreRenderComplete
view state is saved.)

(last event before the page's

- SaveControlState
- SaveViewState

(Control/Viewstate data are serialized to _VIEWSTATE)

- Render and Unload

(Renders the html to Client, Final Cleanup,closing
db, finishing up logging..etc)

Conferrer: Vijay Goyal, Mindfire Solutions
A Scenario

Conferrer: Vijay Goyal, Mindfire Solutions
Dynamically Added Controls
- They are not part of the compiled class
- Should be added in every page execution
- Plays catchup

(go thru all the page life cycle events of their own, Before
Page Render)

- Recommended to call in PreInit or Init, before tracking is
enabled

Conferrer: Vijay Goyal, Mindfire Solutions
Abbreviating ViewState
- Disable ViewState
- System.Web.UI.LosFormatter

(Limited Object Serialization)

- Compress/Decompress

(SavePageStateToPersistenceMedium,
LoadPageStateFromPersistenceMedium)

- Store in an external file

(Use SessionId/ GUID)

- Others... (Flesk.ViewStateOptimizer)
Conferrer: Vijay Goyal, Mindfire Solutions
Security??
- ViewState Decoder (a nice tool created by Fritz Onion).
- EnableViewStateMac
- ViewStateEncryptionMode

(Always/Auto , control calls
Page.RegisterRequiresViewStateEncryption() /Never)

Conferrer: Vijay Goyal, Mindfire Solutions
Prevent Tampering

Conferrer: Vijay Goyal, Mindfire Solutions
Prevent Tampering

Conferrer: Vijay Goyal, Mindfire Solutions
Here and there...
Machine.Config file <machineKey validation="SHA1"
validationKey="F3690E7A3143C185AB1089616A8B4D81FD55DD7A69EEAA3B32A6AE
813ECEECD28DEA66A23BEE42193729BD48595EBAFE2C2E765BE77E006330BC3B139
2D7C73F" DecryptionKey =” ” />
-

Local Security Authority Subsystem Service component

- References
http://msdn.microsoft.com/en-us/library/ff649308.aspx
http://msdn.microsoft.com/en-us/library/ms178472.aspx
http://pluralsight.com

Conferrer: Vijay Goyal, Mindfire Solutions
Conferrer: Vijay Goyal, Mindfire Solutions
Presenter: Vijay Goyal, Mindfire Solutions

Mais conteúdo relacionado

Mais procurados

ASP.NET Page Life Cycle
ASP.NET Page Life CycleASP.NET Page Life Cycle
ASP.NET Page Life CycleAbhishek Sur
 
Page life cycle
Page life cyclePage life cycle
Page life cycleanil4691
 
Rest web service_with_spring_hateoas
Rest web service_with_spring_hateoasRest web service_with_spring_hateoas
Rest web service_with_spring_hateoasZeid Hassan
 
Building Modern Web Applications using React and Redux
 Building Modern Web Applications using React and Redux Building Modern Web Applications using React and Redux
Building Modern Web Applications using React and ReduxMaxime Najim
 
M S Ajax Client Life Cycle Events
M S  Ajax  Client  Life  Cycle  EventsM S  Ajax  Client  Life  Cycle  Events
M S Ajax Client Life Cycle Events51 lecture
 
Academy PRO: React JS. Redux & Tooling
Academy PRO: React JS. Redux & ToolingAcademy PRO: React JS. Redux & Tooling
Academy PRO: React JS. Redux & ToolingBinary Studio
 
ReactJs presentation
ReactJs presentationReactJs presentation
ReactJs presentationnishasowdri
 
Grails Connecting to MySQL
Grails Connecting to MySQLGrails Connecting to MySQL
Grails Connecting to MySQLashishkirpan
 
multiple views and routing
multiple views and routingmultiple views and routing
multiple views and routingBrajesh Yadav
 
React js programming concept
React js programming conceptReact js programming concept
React js programming conceptTariqul islam
 

Mais procurados (20)

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
 
Rest web service_with_spring_hateoas
Rest web service_with_spring_hateoasRest web service_with_spring_hateoas
Rest web service_with_spring_hateoas
 
Life cycle of web page
Life cycle of web pageLife cycle of web page
Life cycle of web page
 
Let's react - Meetup
Let's react - MeetupLet's react - Meetup
Let's react - Meetup
 
Intro to ReactJS
Intro to ReactJSIntro to ReactJS
Intro to ReactJS
 
Building Modern Web Applications using React and Redux
 Building Modern Web Applications using React and Redux Building Modern Web Applications using React and Redux
Building Modern Web Applications using React and Redux
 
M S Ajax Client Life Cycle Events
M S  Ajax  Client  Life  Cycle  EventsM S  Ajax  Client  Life  Cycle  Events
M S Ajax Client Life Cycle Events
 
React outbox
React outboxReact outbox
React outbox
 
Intro to React
Intro to ReactIntro to React
Intro to React
 
Academy PRO: React JS. Redux & Tooling
Academy PRO: React JS. Redux & ToolingAcademy PRO: React JS. Redux & Tooling
Academy PRO: React JS. Redux & Tooling
 
Redux Universal
Redux UniversalRedux Universal
Redux Universal
 
ReactJs presentation
ReactJs presentationReactJs presentation
ReactJs presentation
 
As pnet pagelife_usha
As pnet pagelife_ushaAs pnet pagelife_usha
As pnet pagelife_usha
 
Getting Started With ReactJS
Getting Started With ReactJSGetting Started With ReactJS
Getting Started With ReactJS
 
Grails Connecting to MySQL
Grails Connecting to MySQLGrails Connecting to MySQL
Grails Connecting to MySQL
 
multiple views and routing
multiple views and routingmultiple views and routing
multiple views and routing
 
React js programming concept
React js programming conceptReact js programming concept
React js programming concept
 
Using redux
Using reduxUsing redux
Using redux
 
Introduction to react js
Introduction to react jsIntroduction to react js
Introduction to react js
 

Destaque

ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentationivpol
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVCKhaled Musaied
 
Applying Domain Driven Design on Asp.net MVC – Part 1: Asp.net MVC
Applying Domain Driven Design on Asp.net MVC – Part 1: Asp.net MVCApplying Domain Driven Design on Asp.net MVC – Part 1: Asp.net MVC
Applying Domain Driven Design on Asp.net MVC – Part 1: Asp.net MVCMohamed Meligy
 
ASP.NET MVC4 Overview
ASP.NET MVC4 OverviewASP.NET MVC4 Overview
ASP.NET MVC4 OverviewMahmoud Tolba
 
Technical screening .Net Developer
Technical screening  .Net DeveloperTechnical screening  .Net Developer
Technical screening .Net DeveloperTom Henricksen
 
User server interaction
User server interactionUser server interaction
User server interactionbhavanatmithun
 
Introducing asp.net web pages 2
Introducing asp.net web pages 2Introducing asp.net web pages 2
Introducing asp.net web pages 2Uh-meet Thapa
 
Directives in asp.net
Directives in asp.netDirectives in asp.net
Directives in asp.netSireesh K
 
State management
State managementState management
State managementteach4uin
 
Custom controls
Custom controlsCustom controls
Custom controlsaspnet123
 
Asp.net server control
Asp.net  server controlAsp.net  server control
Asp.net server controlSireesh K
 
Server Controls of ASP.Net
Server Controls of ASP.NetServer Controls of ASP.Net
Server Controls of ASP.NetHitesh Santani
 
State Management In ASP.NET And ASP.NET MVC
State Management In ASP.NET And ASP.NET MVCState Management In ASP.NET And ASP.NET MVC
State Management In ASP.NET And ASP.NET MVCjinaldesailive
 
ASP.NET State management
ASP.NET State managementASP.NET State management
ASP.NET State managementShivanand Arur
 
HTTP request and response
HTTP request and responseHTTP request and response
HTTP request and responseSahil Agarwal
 

Destaque (20)

ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
 
Applying Domain Driven Design on Asp.net MVC – Part 1: Asp.net MVC
Applying Domain Driven Design on Asp.net MVC – Part 1: Asp.net MVCApplying Domain Driven Design on Asp.net MVC – Part 1: Asp.net MVC
Applying Domain Driven Design on Asp.net MVC – Part 1: Asp.net MVC
 
ASP.NET MVC4 Overview
ASP.NET MVC4 OverviewASP.NET MVC4 Overview
ASP.NET MVC4 Overview
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 
Introduction to ASP.Net Viewstate
Introduction to ASP.Net ViewstateIntroduction to ASP.Net Viewstate
Introduction to ASP.Net Viewstate
 
Technical screening .Net Developer
Technical screening  .Net DeveloperTechnical screening  .Net Developer
Technical screening .Net Developer
 
ASP.NET - Web Programming
ASP.NET - Web ProgrammingASP.NET - Web Programming
ASP.NET - Web Programming
 
Asp.Net Control Architecture
Asp.Net Control ArchitectureAsp.Net Control Architecture
Asp.Net Control Architecture
 
User server interaction
User server interactionUser server interaction
User server interaction
 
Introducing asp.net web pages 2
Introducing asp.net web pages 2Introducing asp.net web pages 2
Introducing asp.net web pages 2
 
Directives in asp.net
Directives in asp.netDirectives in asp.net
Directives in asp.net
 
State management
State managementState management
State management
 
Custom controls
Custom controlsCustom controls
Custom controls
 
Asp.net server control
Asp.net  server controlAsp.net  server control
Asp.net server control
 
Server Controls of ASP.Net
Server Controls of ASP.NetServer Controls of ASP.Net
Server Controls of ASP.Net
 
State Management In ASP.NET And ASP.NET MVC
State Management In ASP.NET And ASP.NET MVCState Management In ASP.NET And ASP.NET MVC
State Management In ASP.NET And ASP.NET MVC
 
ASP.NET State management
ASP.NET State managementASP.NET State management
ASP.NET State management
 
Ch3 server controls
Ch3 server controlsCh3 server controls
Ch3 server controls
 
HTTP request and response
HTTP request and responseHTTP request and response
HTTP request and response
 

Semelhante a ASP.NET Page life cycle and ViewState

Aspnetpagelifecycle 101129103702-phpapp02
Aspnetpagelifecycle 101129103702-phpapp02Aspnetpagelifecycle 101129103702-phpapp02
Aspnetpagelifecycle 101129103702-phpapp02santoshkjogalekar
 
Aspnet life cycle events
Aspnet life cycle eventsAspnet life cycle events
Aspnet life cycle eventsTrushant parkar
 
Asp dot net lifecycle in details
Asp dot net lifecycle in detailsAsp dot net lifecycle in details
Asp dot net lifecycle in detailsAyesha 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
 
Parallelminds.asp.net with sp
Parallelminds.asp.net with spParallelminds.asp.net with sp
Parallelminds.asp.net with spparallelminder
 
Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development Mahmoud Hamed Mahmoud
 
Thinking metrics on React apps
Thinking metrics on React appsThinking metrics on React apps
Thinking metrics on React appsJean Carlo Emer
 
MVP Community Camp 2014 - How to use enhanced features of Windows 8.1 Store ...
MVP Community Camp 2014 - How to useenhanced features of Windows 8.1 Store ...MVP Community Camp 2014 - How to useenhanced features of Windows 8.1 Store ...
MVP Community Camp 2014 - How to use enhanced features of Windows 8.1 Store ...Akira Hatsune
 
Hybrid App using WordPress
Hybrid App using WordPressHybrid App using WordPress
Hybrid App using WordPressHaim Michael
 
The WebView Role in Hybrid Applications
The WebView Role in Hybrid ApplicationsThe WebView Role in Hybrid Applications
The WebView Role in Hybrid ApplicationsHaim Michael
 
Battle of React State Managers in frontend applications
Battle of React State Managers in frontend applicationsBattle of React State Managers in frontend applications
Battle of React State Managers in frontend applicationsEvangelia Mitsopoulou
 
Reactive state management with Jetpack Components
Reactive state management with Jetpack ComponentsReactive state management with Jetpack Components
Reactive state management with Jetpack ComponentsGabor Varadi
 
[22]Efficient and Testable MVVM pattern
[22]Efficient and Testable MVVM pattern[22]Efficient and Testable MVVM pattern
[22]Efficient and Testable MVVM patternNAVER Engineering
 
A test framework out of the box - Geb for Web and mobile
A test framework out of the box - Geb for Web and mobileA test framework out of the box - Geb for Web and mobile
A test framework out of the box - Geb for Web and mobileGlobalLogic Ukraine
 
Building Testable Reactive Apps with MVI
Building Testable Reactive Apps with MVIBuilding Testable Reactive Apps with MVI
Building Testable Reactive Apps with MVIJames Shvarts
 
AnDevCon - Tracking User Behavior Creatively
AnDevCon - Tracking User Behavior CreativelyAnDevCon - Tracking User Behavior Creatively
AnDevCon - Tracking User Behavior CreativelyKiana Tennyson
 
Week7 Dreamweaver Behavior & Image Hotspots
Week7 Dreamweaver Behavior & Image HotspotsWeek7 Dreamweaver Behavior & Image Hotspots
Week7 Dreamweaver Behavior & Image HotspotsRowena LI
 

Semelhante a ASP.NET Page life cycle and ViewState (20)

Aspnetpagelifecycle 101129103702-phpapp02
Aspnetpagelifecycle 101129103702-phpapp02Aspnetpagelifecycle 101129103702-phpapp02
Aspnetpagelifecycle 101129103702-phpapp02
 
Aspnet life cycle events
Aspnet life cycle eventsAspnet life cycle events
Aspnet life cycle 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?
 
Parallelminds.asp.net with sp
Parallelminds.asp.net with spParallelminds.asp.net with sp
Parallelminds.asp.net with sp
 
Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development
 
Thinking metrics on React apps
Thinking metrics on React appsThinking metrics on React apps
Thinking metrics on React apps
 
Page life cycle
Page life cyclePage life cycle
Page life cycle
 
MVP Community Camp 2014 - How to use enhanced features of Windows 8.1 Store ...
MVP Community Camp 2014 - How to useenhanced features of Windows 8.1 Store ...MVP Community Camp 2014 - How to useenhanced features of Windows 8.1 Store ...
MVP Community Camp 2014 - How to use enhanced features of Windows 8.1 Store ...
 
Hybrid App using WordPress
Hybrid App using WordPressHybrid App using WordPress
Hybrid App using WordPress
 
The WebView Role in Hybrid Applications
The WebView Role in Hybrid ApplicationsThe WebView Role in Hybrid Applications
The WebView Role in Hybrid Applications
 
Battle of React State Managers in frontend applications
Battle of React State Managers in frontend applicationsBattle of React State Managers in frontend applications
Battle of React State Managers in frontend applications
 
Reactive state management with Jetpack Components
Reactive state management with Jetpack ComponentsReactive state management with Jetpack Components
Reactive state management with Jetpack Components
 
[22]Efficient and Testable MVVM pattern
[22]Efficient and Testable MVVM pattern[22]Efficient and Testable MVVM pattern
[22]Efficient and Testable MVVM pattern
 
A test framework out of the box - Geb for Web and mobile
A test framework out of the box - Geb for Web and mobileA test framework out of the box - Geb for Web and mobile
A test framework out of the box - Geb for Web and mobile
 
Building Testable Reactive Apps with MVI
Building Testable Reactive Apps with MVIBuilding Testable Reactive Apps with MVI
Building Testable Reactive Apps with MVI
 
Android Oreo
Android OreoAndroid Oreo
Android Oreo
 
AnDevCon - Tracking User Behavior Creatively
AnDevCon - Tracking User Behavior CreativelyAnDevCon - Tracking User Behavior Creatively
AnDevCon - Tracking User Behavior Creatively
 
Asp.net control
Asp.net controlAsp.net control
Asp.net control
 
Week7 Dreamweaver Behavior & Image Hotspots
Week7 Dreamweaver Behavior & Image HotspotsWeek7 Dreamweaver Behavior & Image Hotspots
Week7 Dreamweaver Behavior & Image Hotspots
 

Mais de Mindfire Solutions (20)

Physician Search and Review
Physician Search and ReviewPhysician Search and Review
Physician Search and Review
 
diet management app
diet management appdiet management app
diet management app
 
Business Technology Solution
Business Technology SolutionBusiness Technology Solution
Business Technology Solution
 
Remote Health Monitoring
Remote Health MonitoringRemote Health Monitoring
Remote Health Monitoring
 
Influencer Marketing Solution
Influencer Marketing SolutionInfluencer Marketing Solution
Influencer Marketing Solution
 
ELMAH
ELMAHELMAH
ELMAH
 
High Availability of Azure Applications
High Availability of Azure ApplicationsHigh Availability of Azure Applications
High Availability of Azure Applications
 
IOT Hands On
IOT Hands OnIOT Hands On
IOT Hands On
 
Glimpse of Loops Vs Set
Glimpse of Loops Vs SetGlimpse of Loops Vs Set
Glimpse of Loops Vs Set
 
Oracle Sql Developer-Getting Started
Oracle Sql Developer-Getting StartedOracle Sql Developer-Getting Started
Oracle Sql Developer-Getting Started
 
Adaptive Layout In iOS 8
Adaptive Layout In iOS 8Adaptive Layout In iOS 8
Adaptive Layout In iOS 8
 
Introduction to Auto-layout : iOS/Mac
Introduction to Auto-layout : iOS/MacIntroduction to Auto-layout : iOS/Mac
Introduction to Auto-layout : iOS/Mac
 
LINQPad - utility Tool
LINQPad - utility ToolLINQPad - utility Tool
LINQPad - utility Tool
 
Get started with watch kit development
Get started with watch kit developmentGet started with watch kit development
Get started with watch kit development
 
Swift vs Objective-C
Swift vs Objective-CSwift vs Objective-C
Swift vs Objective-C
 
Material Design in Android
Material Design in AndroidMaterial Design in Android
Material Design in Android
 
Introduction to OData
Introduction to ODataIntroduction to OData
Introduction to OData
 
Ext js Part 2- MVC
Ext js Part 2- MVCExt js Part 2- MVC
Ext js Part 2- MVC
 
ExtJs Basic Part-1
ExtJs Basic Part-1ExtJs Basic Part-1
ExtJs Basic Part-1
 
Spring Security Introduction
Spring Security IntroductionSpring Security Introduction
Spring Security Introduction
 

Último

AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 

Último (20)

AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 

ASP.NET Page life cycle and ViewState

  • 1. Page Life Cycle And ViewState Presenter: Vijay Goyal, Mindfire Solutions Skype: mfsi_vijayg Date: 30/09/2013
  • 2. Agenda Of The Seminar - Pre Page Life Cyle (Asp.Net Inside IIS) What on Earth is ViewState? The different (Important) stages of Life Cycle Where ViewState comes into the picture? Dynamically created control Deal with the burden of ViewState on the page Some Demo...with some more Demo Conferrer: Vijay Goyal, Mindfire Solutions
  • 3. This is not an IIS course Conferrer: Vijay Goyal, Mindfire Solutions
  • 4. The Two Important Services Conferrer: Vijay Goyal, Mindfire Solutions
  • 5. The ProcessRequest() - After all the registered Modules are executed. The page is ready to be served. - For this IIS uses the handler's mapping, to map the request to the appropriate handler. - ProcessRequest() method is executed and Page Life Cycle begins Conferrer: Vijay Goyal, Mindfire Solutions.
  • 6. The Page Life Cycle Begins.. Conferrer: Vijay Goyal, Mindfire Solutions
  • 7. Formation Of Control Heirarchy - Request to an aspx page is served by a compiled class “C:WindowsMicrosoft.NETFrameworkv4.0.30319Temp orary ASP.NET Files” - Initializes the page's control hierarchy Conferrer: Vijay Goyal, Mindfire Solutions
  • 8. Formation Of Control Heirarchy Conferrer: Vijay Goyal, Mindfire Solutions
  • 9. But What's ViewState?? - Its a misunderstood topic An object of Statebag class Stores changes done programatically SelectedIndex / PageIndex not stored A property of System.Web.UI.Controls A key/value pair indexer. Serialized to _VIEWSTATE hidden field ViewState is a hungry beast. Conferrer: Vijay Goyal, Mindfire Solutions
  • 10. Initialization - PreInit (Entry point, Non Recursive) - Init (Tracking of Viewstate is not enabled / Enabled for child controls, Recursive) - InitComplete (Viewstate tracking is turned on, Non Recursive) - SaveViewState() - Page.TrackViewState() Conferrer: Vijay Goyal, Mindfire Solutions.
  • 11. Load ViewState/Page Data - Invoked only on Postbacks - LoadControlState (Introduced in Asp.Net 2.0, gridview page control, SaveControlState()l) - LoadViewState SaveViewState()) - LoadPostData (Page and controls restored, (Controls implement IpostBackDataHandler, Selected value in dropdown, checkbox, Textbox) Conferrer: Vijay Goyal, Mindfire Solutions.
  • 12. Loading the Page... - PreLoad (Non Recursive, End of Viewstate data load) - Load (Top down approach, Previous State is fully loaded) - RaisePostDataChangeEvent (Controls implement IpostBackDataHandler, TextChanged/SelectedIndexChanged) - RaisePostBackEvent click event) - LoadComplete (Controls implement IpostBackDataHandler, (Page only) Conferrer: Vijay Goyal, Mindfire Solutions
  • 13. Page Rendering - PreRender (Recursive, Last update before the page is rendered) - PreRenderComplete view state is saved.) (last event before the page's - SaveControlState - SaveViewState (Control/Viewstate data are serialized to _VIEWSTATE) - Render and Unload (Renders the html to Client, Final Cleanup,closing db, finishing up logging..etc) Conferrer: Vijay Goyal, Mindfire Solutions
  • 14. A Scenario Conferrer: Vijay Goyal, Mindfire Solutions
  • 15. Dynamically Added Controls - They are not part of the compiled class - Should be added in every page execution - Plays catchup (go thru all the page life cycle events of their own, Before Page Render) - Recommended to call in PreInit or Init, before tracking is enabled Conferrer: Vijay Goyal, Mindfire Solutions
  • 16. Abbreviating ViewState - Disable ViewState - System.Web.UI.LosFormatter (Limited Object Serialization) - Compress/Decompress (SavePageStateToPersistenceMedium, LoadPageStateFromPersistenceMedium) - Store in an external file (Use SessionId/ GUID) - Others... (Flesk.ViewStateOptimizer) Conferrer: Vijay Goyal, Mindfire Solutions
  • 17. Security?? - ViewState Decoder (a nice tool created by Fritz Onion). - EnableViewStateMac - ViewStateEncryptionMode (Always/Auto , control calls Page.RegisterRequiresViewStateEncryption() /Never) Conferrer: Vijay Goyal, Mindfire Solutions
  • 18. Prevent Tampering Conferrer: Vijay Goyal, Mindfire Solutions
  • 19. Prevent Tampering Conferrer: Vijay Goyal, Mindfire Solutions
  • 20. Here and there... Machine.Config file <machineKey validation="SHA1" validationKey="F3690E7A3143C185AB1089616A8B4D81FD55DD7A69EEAA3B32A6AE 813ECEECD28DEA66A23BEE42193729BD48595EBAFE2C2E765BE77E006330BC3B139 2D7C73F" DecryptionKey =” ” /> - Local Security Authority Subsystem Service component - References http://msdn.microsoft.com/en-us/library/ff649308.aspx http://msdn.microsoft.com/en-us/library/ms178472.aspx http://pluralsight.com Conferrer: Vijay Goyal, Mindfire Solutions
  • 21. Conferrer: Vijay Goyal, Mindfire Solutions
  • 22. Presenter: Vijay Goyal, Mindfire Solutions