Difference between revisions of "State Management in ASP.NET"

From JholJhapata
Line 13: Line 13:
 
   
 
   
 
=== Hidden field ===
 
=== Hidden field ===
 +
[[ASP.NET Hidden Field|Hidden Field]] is non visual control in ASP.NET where we can save the value. This is one of the types of client-side state management tools. It stores the value between the roundtrip. Anyone can see Hidden Field details by simply viewing the source of document.
 
=== Cookies ===
 
=== Cookies ===
 
=== Control State ===
 
=== Control State ===

Revision as of 15:13, 23 January 2020

As we all know, HTTP or HTTPS is stateless protocol. It just cleans up or we can say removes all the resources/references that were serving a specific request in the past.

Stateless means, whenever we visit a website, our browser communicates with the respective server depending on our requested functionality or the request. In this case HTTP/HTTPs doesn't remember what website or URL we visited, or in other words we can say it doesn't hold the state of a previous website that we visited before closing our browser, that is called stateless.

So our browsers are stateless.

State Management Types

State Management Techniques

Client-side | Techniques

View State

View State is the method to preserve the Value of the Page and Controls between round trips. It is a Page-Level State Management technique. View State is turned on by default and normally serializes the data in every control on the page regardless of whether it is actually used during a post-back.Please keep in mind though, that while cookies and sessions can be accessed from all your pages on your website, ViewState values are not carried between pages.

Hidden field

Hidden Field is non visual control in ASP.NET where we can save the value. This is one of the types of client-side state management tools. It stores the value between the roundtrip. Anyone can see Hidden Field details by simply viewing the source of document.

Cookies

Control State

Query Strings

Server-side | Technique

Session State

InProc

OutProc

Application State