SlideShare a Scribd company logo
Articles from Jinal Desai .NET
State Management in ASP.NET and ASP.NET MVC
2013-03-15 17:03:17 Jinal Desai

As we all know HTML is stateless language. It cannot persist state, so every web
development framework provides facility to maintain state in one way or another
way. There are different techniques available for state management in ASP.NET and
ASP.NET MVC. Following is summary of all such techniques for maintaining state.

Client Based State Management Options

               The ViewState property provides a dictionary object for retaining
View State
               values between multiple requests for the same page.
               The ControlState property allows you to persist property information
Control
               that is specific to a control and cannot be turned off like the ViewState
State
               property.
Hidden         A HiddenField control stores a single variable in its Value property and
Fields         must be explicitly added to the page.
               A cookie is a small amount of data that is stored either in a text file on
Cookies
               the client file system or in-memory in the client browser session.
Query          A query string is information that is appended to the end of a page
String         URL.
View
          ViewData is a dictionary of objects accessible using strings as keys.
Data(MVC)
View     ViewBag is a dynamic property. It does not require typecasting for
Bag(MVC) complex objects.
          TempData is a dictionary of string key and object value. TempData
Temp
          keep the information for the time of an HTTP Request. This mean only
Data(MVC)
          from one page to another.



Server Based State Management Options

Application Application state is a global storage mechanism that is accessible
State       from all pages in the Web application.
Session        Session state is similar to application state, except that it is scoped to
State          the current browser session.
           Profile Properties is similar to Session State. The profile-properties
Profile
           feature uses an ASP.NET profile, which is stored in a persistent format
Properties
           and associated with an individual user.
Ad

Recommended

ASP.NET State management
ASP.NET State management
Shivanand Arur
 
State management
State management
Iblesoft
 
State management in ASP .NET
State management in ASP .NET
baabtra.com - No. 1 supplier of quality freshers
 
State management
State management
teach4uin
 
state managment
state managment
aniliimd
 
Introduction to asp .net
Introduction to asp .net
umesh patil
 
State Management in ASP.NET
State Management in ASP.NET
Shyam Sir
 
Introduction to asp .net
Introduction to asp .net
umesh patil
 
State management in asp.net
State management in asp.net
baabtra.com - No. 1 supplier of quality freshers
 
Session and state management
Session and state management
Paneliya Prince
 
State management in ASP.NET
State management in ASP.NET
Om Vikram Thapa
 
C# cookieless session id and application state
C# cookieless session id and application state
Malav Patel
 
Building modular single page applications
Building modular single page applications
Anatolii Maslov
 
05 asp.net session07
05 asp.net session07
Mani Chaubey
 
Web development: Why do we need it ?
Web development: Why do we need it ?
anubhavdoodleblue123
 
Bt0083, server side programming theory
Bt0083, server side programming theory
smumbahelp
 
Employee Self Services Portal
Employee Self Services Portal
Mike Taylor
 
Assi 3 tm
Assi 3 tm
university of Gujrat, pakistan
 
Difference between mvc 2 and mvc 3 in asp.net
Difference between mvc 2 and mvc 3 in asp.net
Umar Ali
 
ASP.NET lecture 8
ASP.NET lecture 8
Julie Iskander
 
SharePoint Saturday bmore2015
SharePoint Saturday bmore2015
Bhakthi Liyanage
 
ASP.NET MVC Interview Questions and Answers by Shailendra Chauhan
ASP.NET MVC Interview Questions and Answers by Shailendra Chauhan
Shailendra Chauhan
 
Top 100 .Net Interview Questions and Answer
Top 100 .Net Interview Questions and Answer
Vineet Kumar Saini
 
MS.Net Interview Questions - Simplified
MS.Net Interview Questions - Simplified
Mohd Manzoor Ahmed
 
C# interview quesions
C# interview quesions
Shashwat Shriparv
 
ASP.NET MVC4 Overview
ASP.NET MVC4 Overview
Mahmoud Tolba
 
Asp.net mvc
Asp.net mvc
Naga Harish M
 
Introduction to ASP.Net Viewstate
Introduction to ASP.Net Viewstate
n|u - The Open Security Community
 
Asp.net MVC DI
Asp.net MVC DI
LearningTech
 
ASP.NET MVC difference between questions list 1
ASP.NET MVC difference between questions list 1
Umar Ali
 

More Related Content

What's hot (13)

State management in asp.net
State management in asp.net
baabtra.com - No. 1 supplier of quality freshers
 
Session and state management
Session and state management
Paneliya Prince
 
State management in ASP.NET
State management in ASP.NET
Om Vikram Thapa
 
C# cookieless session id and application state
C# cookieless session id and application state
Malav Patel
 
Building modular single page applications
Building modular single page applications
Anatolii Maslov
 
05 asp.net session07
05 asp.net session07
Mani Chaubey
 
Web development: Why do we need it ?
Web development: Why do we need it ?
anubhavdoodleblue123
 
Bt0083, server side programming theory
Bt0083, server side programming theory
smumbahelp
 
Employee Self Services Portal
Employee Self Services Portal
Mike Taylor
 
Assi 3 tm
Assi 3 tm
university of Gujrat, pakistan
 
Difference between mvc 2 and mvc 3 in asp.net
Difference between mvc 2 and mvc 3 in asp.net
Umar Ali
 
ASP.NET lecture 8
ASP.NET lecture 8
Julie Iskander
 
SharePoint Saturday bmore2015
SharePoint Saturday bmore2015
Bhakthi Liyanage
 
Session and state management
Session and state management
Paneliya Prince
 
State management in ASP.NET
State management in ASP.NET
Om Vikram Thapa
 
C# cookieless session id and application state
C# cookieless session id and application state
Malav Patel
 
Building modular single page applications
Building modular single page applications
Anatolii Maslov
 
05 asp.net session07
05 asp.net session07
Mani Chaubey
 
Web development: Why do we need it ?
Web development: Why do we need it ?
anubhavdoodleblue123
 
Bt0083, server side programming theory
Bt0083, server side programming theory
smumbahelp
 
Employee Self Services Portal
Employee Self Services Portal
Mike Taylor
 
Difference between mvc 2 and mvc 3 in asp.net
Difference between mvc 2 and mvc 3 in asp.net
Umar Ali
 
SharePoint Saturday bmore2015
SharePoint Saturday bmore2015
Bhakthi Liyanage
 

Viewers also liked (20)

ASP.NET MVC Interview Questions and Answers by Shailendra Chauhan
ASP.NET MVC Interview Questions and Answers by Shailendra Chauhan
Shailendra Chauhan
 
Top 100 .Net Interview Questions and Answer
Top 100 .Net Interview Questions and Answer
Vineet Kumar Saini
 
MS.Net Interview Questions - Simplified
MS.Net Interview Questions - Simplified
Mohd Manzoor Ahmed
 
C# interview quesions
C# interview quesions
Shashwat Shriparv
 
ASP.NET MVC4 Overview
ASP.NET MVC4 Overview
Mahmoud Tolba
 
Asp.net mvc
Asp.net mvc
Naga Harish M
 
Introduction to ASP.Net Viewstate
Introduction to ASP.Net Viewstate
n|u - The Open Security Community
 
Asp.net MVC DI
Asp.net MVC DI
LearningTech
 
ASP.NET MVC difference between questions list 1
ASP.NET MVC difference between questions list 1
Umar Ali
 
Resolve dependency of dependencies using Inversion of Control and dependency ...
Resolve dependency of dependencies using Inversion of Control and dependency ...
Akhil Mittal
 
Inversion of control using dependency injection in Web APIs using Unity Conta...
Inversion of control using dependency injection in Web APIs using Unity Conta...
Akhil Mittal
 
PDFArticle
PDFArticle
Akhil Mittal
 
Technical Video Training Sites- 1
Technical Video Training Sites- 1
Umar Ali
 
Angularjs Basics
Angularjs Basics
Jayantha Sirisena
 
Difference between authentication and authorization in asp.net
Difference between authentication and authorization in asp.net
Umar Ali
 
ASP.NET Page life cycle and ViewState
ASP.NET Page life cycle and ViewState
Mindfire Solutions
 
C# simplified
C# simplified
Mohd Manzoor Ahmed
 
ASP.NET MVC Presentation
ASP.NET MVC Presentation
ivpol
 
C# ASP.NET WEB API APPLICATION DEVELOPMENT
C# ASP.NET WEB API APPLICATION DEVELOPMENT
Dr. Awase Khirni Syed
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVC
Khaled Musaied
 
ASP.NET MVC Interview Questions and Answers by Shailendra Chauhan
ASP.NET MVC Interview Questions and Answers by Shailendra Chauhan
Shailendra Chauhan
 
Top 100 .Net Interview Questions and Answer
Top 100 .Net Interview Questions and Answer
Vineet Kumar Saini
 
MS.Net Interview Questions - Simplified
MS.Net Interview Questions - Simplified
Mohd Manzoor Ahmed
 
ASP.NET MVC4 Overview
ASP.NET MVC4 Overview
Mahmoud Tolba
 
ASP.NET MVC difference between questions list 1
ASP.NET MVC difference between questions list 1
Umar Ali
 
Resolve dependency of dependencies using Inversion of Control and dependency ...
Resolve dependency of dependencies using Inversion of Control and dependency ...
Akhil Mittal
 
Inversion of control using dependency injection in Web APIs using Unity Conta...
Inversion of control using dependency injection in Web APIs using Unity Conta...
Akhil Mittal
 
Technical Video Training Sites- 1
Technical Video Training Sites- 1
Umar Ali
 
Difference between authentication and authorization in asp.net
Difference between authentication and authorization in asp.net
Umar Ali
 
ASP.NET Page life cycle and ViewState
ASP.NET Page life cycle and ViewState
Mindfire Solutions
 
ASP.NET MVC Presentation
ASP.NET MVC Presentation
ivpol
 
C# ASP.NET WEB API APPLICATION DEVELOPMENT
C# ASP.NET WEB API APPLICATION DEVELOPMENT
Dr. Awase Khirni Syed
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVC
Khaled Musaied
 
Ad

Similar to State Management In ASP.NET And ASP.NET MVC (20)

05 asp.net session07
05 asp.net session07
Niit Care
 
05 asp.net session07
05 asp.net session07
Vivek Singh Chandel
 
State management
State management
Iblesoft
 
Managing state in asp.net
Managing state in asp.net
Sireesh K
 
State management
State management
Muhammad Amir
 
State management in ASP.net
State management in ASP.net
baabtra.com - No. 1 supplier of quality freshers
 
State Management.pptx
State Management.pptx
DrMonikaPatel2
 
State management in asp
State management in asp
Ibrahim MH
 
ASP.NET 12 - State Management
ASP.NET 12 - State Management
Randy Connolly
 
Chapter 8 part1
Chapter 8 part1
application developer
 
State management 1
State management 1
singhadarsh
 
StateManagement in ASP.Net.ppt
StateManagement in ASP.Net.ppt
charusharma165
 
State management
State management
Lalit Kale
 
Asp.net state management
Asp.net state management
priya Nithya
 
Session viii(state mngtclient)
Session viii(state mngtclient)
Shrijan Tiwari
 
Session viii(state mngtserver)
Session viii(state mngtserver)
Shrijan Tiwari
 
state management asp.net
state management asp.net
Pratiksha Srivastava
 
81.pptx ajx fyjc semester paper 2 parrtens
81.pptx ajx fyjc semester paper 2 parrtens
epfoportal69
 
View Bag And Tempdata.pptx
View Bag And Tempdata.pptx
AddiyAli
 
Ch05 state management
Ch05 state management
Madhuri Kavade
 
05 asp.net session07
05 asp.net session07
Niit Care
 
State management
State management
Iblesoft
 
Managing state in asp.net
Managing state in asp.net
Sireesh K
 
State management in asp
State management in asp
Ibrahim MH
 
ASP.NET 12 - State Management
ASP.NET 12 - State Management
Randy Connolly
 
State management 1
State management 1
singhadarsh
 
StateManagement in ASP.Net.ppt
StateManagement in ASP.Net.ppt
charusharma165
 
State management
State management
Lalit Kale
 
Asp.net state management
Asp.net state management
priya Nithya
 
Session viii(state mngtclient)
Session viii(state mngtclient)
Shrijan Tiwari
 
Session viii(state mngtserver)
Session viii(state mngtserver)
Shrijan Tiwari
 
81.pptx ajx fyjc semester paper 2 parrtens
81.pptx ajx fyjc semester paper 2 parrtens
epfoportal69
 
View Bag And Tempdata.pptx
View Bag And Tempdata.pptx
AddiyAli
 
Ad

More from jinaldesailive (6)

Wcf tutorials
Wcf tutorials
jinaldesailive
 
Basic design pattern interview questions
Basic design pattern interview questions
jinaldesailive
 
Exam 70 480 CSS3 at Jinal Desai .NET
Exam 70 480 CSS3 at Jinal Desai .NET
jinaldesailive
 
OOPS With CSharp - Jinal Desai .NET
OOPS With CSharp - Jinal Desai .NET
jinaldesailive
 
Mvc interview questions – deep dive jinal desai
Mvc interview questions – deep dive jinal desai
jinaldesailive
 
Software design principles - jinal desai
Software design principles - jinal desai
jinaldesailive
 
Basic design pattern interview questions
Basic design pattern interview questions
jinaldesailive
 
Exam 70 480 CSS3 at Jinal Desai .NET
Exam 70 480 CSS3 at Jinal Desai .NET
jinaldesailive
 
OOPS With CSharp - Jinal Desai .NET
OOPS With CSharp - Jinal Desai .NET
jinaldesailive
 
Mvc interview questions – deep dive jinal desai
Mvc interview questions – deep dive jinal desai
jinaldesailive
 
Software design principles - jinal desai
Software design principles - jinal desai
jinaldesailive
 

Recently uploaded (20)

CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
Priyanka Aash
 
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
Python Conference Singapore - 19 Jun 2025
Python Conference Singapore - 19 Jun 2025
ninefyi
 
"Database isolation: how we deal with hundreds of direct connections to the d...
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
 
Cyber Defense Matrix Workshop - RSA Conference
Cyber Defense Matrix Workshop - RSA Conference
Priyanka Aash
 
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
Safe Software
 
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
Fwdays
 
You are not excused! How to avoid security blind spots on the way to production
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
AI vs Human Writing: Can You Tell the Difference?
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
 
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
Daily Lesson Log MATATAG ICT TEchnology 8
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Safe Software
 
Securing AI - There Is No Try, Only Do!.pdf
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
 
10 Key Challenges for AI within the EU Data Protection Framework.pdf
10 Key Challenges for AI within the EU Data Protection Framework.pdf
Priyanka Aash
 
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
 
Lessons Learned from Developing Secure AI Workflows.pdf
Lessons Learned from Developing Secure AI Workflows.pdf
Priyanka Aash
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
Priyanka Aash
 
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
Python Conference Singapore - 19 Jun 2025
Python Conference Singapore - 19 Jun 2025
ninefyi
 
"Database isolation: how we deal with hundreds of direct connections to the d...
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
 
Cyber Defense Matrix Workshop - RSA Conference
Cyber Defense Matrix Workshop - RSA Conference
Priyanka Aash
 
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
Safe Software
 
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
Fwdays
 
You are not excused! How to avoid security blind spots on the way to production
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
AI vs Human Writing: Can You Tell the Difference?
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
 
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
Daily Lesson Log MATATAG ICT TEchnology 8
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Safe Software
 
Securing AI - There Is No Try, Only Do!.pdf
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
 
10 Key Challenges for AI within the EU Data Protection Framework.pdf
10 Key Challenges for AI within the EU Data Protection Framework.pdf
Priyanka Aash
 
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
 
Lessons Learned from Developing Secure AI Workflows.pdf
Lessons Learned from Developing Secure AI Workflows.pdf
Priyanka Aash
 

State Management In ASP.NET And ASP.NET MVC

  • 1. Articles from Jinal Desai .NET State Management in ASP.NET and ASP.NET MVC 2013-03-15 17:03:17 Jinal Desai As we all know HTML is stateless language. It cannot persist state, so every web development framework provides facility to maintain state in one way or another way. There are different techniques available for state management in ASP.NET and ASP.NET MVC. Following is summary of all such techniques for maintaining state. Client Based State Management Options The ViewState property provides a dictionary object for retaining View State values between multiple requests for the same page. The ControlState property allows you to persist property information Control that is specific to a control and cannot be turned off like the ViewState State property. Hidden A HiddenField control stores a single variable in its Value property and Fields must be explicitly added to the page. A cookie is a small amount of data that is stored either in a text file on Cookies the client file system or in-memory in the client browser session. Query A query string is information that is appended to the end of a page String URL. View ViewData is a dictionary of objects accessible using strings as keys. Data(MVC) View ViewBag is a dynamic property. It does not require typecasting for Bag(MVC) complex objects. TempData is a dictionary of string key and object value. TempData Temp keep the information for the time of an HTTP Request. This mean only Data(MVC) from one page to another. Server Based State Management Options Application Application state is a global storage mechanism that is accessible State from all pages in the Web application. Session Session state is similar to application state, except that it is scoped to State the current browser session. Profile Properties is similar to Session State. The profile-properties Profile feature uses an ASP.NET profile, which is stored in a persistent format Properties and associated with an individual user.