SlideShare a Scribd company logo
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

More Related Content

What's hot

ASP.NET Page Life Cycle
ASP.NET Page Life CycleASP.NET Page Life Cycle
ASP.NET Page Life Cycle
Abhishek Sur
 
Page life cycle
Page life cyclePage life cycle
Page life cycle
anil4691
 
Rest web service_with_spring_hateoas
Rest web service_with_spring_hateoasRest web service_with_spring_hateoas
Rest web service_with_spring_hateoas
Zeid Hassan
 
Life cycle of web page
Life cycle of web pageLife cycle of web page
Life cycle of web page
university of Gujrat, pakistan
 
Let's react - Meetup
Let's react - MeetupLet's react - Meetup
Let's react - Meetup
RAJNISH KATHAROTIYA
 
Intro to ReactJS
Intro to ReactJSIntro to ReactJS
Intro to ReactJS
Harvard Web Working Group
 
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
Maxime 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
 
React outbox
React outboxReact outbox
React outbox
Angela Lehru
 
Intro to React
Intro to ReactIntro to React
Intro to React
Eric Westfall
 
Academy PRO: React JS. Redux & Tooling
Academy PRO: React JS. Redux & ToolingAcademy PRO: React JS. Redux & Tooling
Academy PRO: React JS. Redux & Tooling
Binary Studio
 
Redux Universal
Redux UniversalRedux Universal
Redux Universal
Nikolaus Graf
 
ReactJs presentation
ReactJs presentationReactJs presentation
ReactJs presentation
nishasowdri
 
As pnet pagelife_usha
As pnet pagelife_ushaAs pnet pagelife_usha
As pnet pagelife_usha
Rajalaxmi Pattanaik
 
Grails Connecting to MySQL
Grails Connecting to MySQLGrails Connecting to MySQL
Grails Connecting to MySQL
ashishkirpan
 
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 concept
Tariqul islam
 
Using redux
Using reduxUsing redux
Using redux
Jonas Ohlsson Aden
 
Introduction to react js
Introduction to react jsIntroduction to react js
Introduction to react js
Aeshan Wijetunge
 

What's hot (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
 

Viewers also liked

ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
ivpol
 
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 MVC
Mohamed Meligy
 
ASP.NET MVC4 Overview
ASP.NET MVC4 OverviewASP.NET MVC4 Overview
ASP.NET MVC4 Overview
Mahmoud Tolba
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
Naga Harish M
 
Introduction to ASP.Net Viewstate
Introduction to ASP.Net ViewstateIntroduction to ASP.Net Viewstate
Introduction to ASP.Net Viewstate
n|u - The Open Security Community
 
Technical screening .Net Developer
Technical screening  .Net DeveloperTechnical screening  .Net Developer
Technical screening .Net Developer
Tom Henricksen
 
User server interaction
User server interactionUser server interaction
User server interaction
bhavanatmithun
 
Introducing asp.net web pages 2
Introducing asp.net web pages 2Introducing asp.net web pages 2
Introducing asp.net web pages 2
Uh-meet Thapa
 
Directives in asp.net
Directives in asp.netDirectives in asp.net
Directives in asp.net
Sireesh K
 
State management
State managementState management
State management
teach4uin
 
Custom controls
Custom controlsCustom controls
Custom controlsaspnet123
 
Asp.net server control
Asp.net  server controlAsp.net  server control
Asp.net server control
Sireesh K
 
Server Controls of ASP.Net
Server Controls of ASP.NetServer Controls of ASP.Net
Server Controls of ASP.Net
Hitesh 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 MVC
jinaldesailive
 
ASP.NET State management
ASP.NET State managementASP.NET State management
ASP.NET State management
Shivanand Arur
 
HTTP request and response
HTTP request and responseHTTP request and response
HTTP request and response
Sahil Agarwal
 

Viewers also liked (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
 

Similar to 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 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
 
Parallelminds.asp.net with sp
Parallelminds.asp.net with spParallelminds.asp.net with sp
Parallelminds.asp.net with sp
parallelminder
 
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 apps
Jean Carlo Emer
 
Page life cycle
Page life cyclePage life cycle
Page life cycle
AsamHussain3
 
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 WordPress
Haim Michael
 
The WebView Role in Hybrid Applications
The WebView Role in Hybrid ApplicationsThe WebView Role in Hybrid Applications
The WebView Role in Hybrid Applications
Haim 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 applications
Evangelia Mitsopoulou
 
Reactive state management with Jetpack Components
Reactive state management with Jetpack ComponentsReactive state management with Jetpack Components
Reactive state management with Jetpack Components
Gabor Varadi
 
[22]Efficient and Testable MVVM pattern
[22]Efficient and Testable MVVM pattern[22]Efficient and Testable MVVM pattern
[22]Efficient and Testable MVVM pattern
NAVER 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 mobile
GlobalLogic Ukraine
 
Building Testable Reactive Apps with MVI
Building Testable Reactive Apps with MVIBuilding Testable Reactive Apps with MVI
Building Testable Reactive Apps with MVI
James Shvarts
 
Android Oreo
Android OreoAndroid Oreo
Android Oreo
Siddharth Yadav
 
AnDevCon - Tracking User Behavior Creatively
AnDevCon - Tracking User Behavior CreativelyAnDevCon - Tracking User Behavior Creatively
AnDevCon - Tracking User Behavior CreativelyKiana Tennyson
 
Asp.net control
Asp.net controlAsp.net control
Asp.net control
Paneliya Prince
 
Week7 Dreamweaver Behavior & Image Hotspots
Week7 Dreamweaver Behavior & Image HotspotsWeek7 Dreamweaver Behavior & Image Hotspots
Week7 Dreamweaver Behavior & Image HotspotsRowena LI
 

Similar to 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
 

More from Mindfire Solutions

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

More from 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
 

Recently uploaded

JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 

Recently uploaded (20)

JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 

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