State Management in ASP.NET
· In an ASP NET application, state management in ASP NET is an object and preserves type state control.
· This is because ASP NET applications are basically stateless.
· In ASP NET, the information of users is stored and maintained till the user session ends.
· Each time the page is posted on the server, a new instance of the Web page class is created.
Types of State Management in ASP.NET
There are two types of State management in ASP net.
· Server-side
· Client-side
Server-side
An important technique to maintain state. It is used to store identity and information; information is stored in the server using Sessionid.
Session
Two types –
· Session starts – Raised every time a new user requests without a session ID.
· Session end – Raised everytime the user ends the session or a time out occurs.
The session is stored in the following ways in ASP.NET:
· InProcMode – Default session mode. When the server starts, the session value is stored, and when the server is restarted, it ends.
· State Server Mode – Session date is made to store on a separate server in this mode.
· SQL Server Mode – It’s a secure mode in which the session is made to store in the database.
· Custom Mode – Session data is generally stored in InProcMode, SQL Server Mode, etc. In case we want to store using any other techniques, we use the custom mode.
Application
· It is a server-side management state and is also known as the application level state management.
· This is mainly used to store user activity in server memory and application events.
Further classified into three types :
· Application start – The event begins with the start of the domain.
· Application error – This is used to manage/handle an error or exception that had been previously unhandled.
· Application end – Whenever the domain ends, this ends as well.
Cache
· This is stored on the server-side, and it is used to implement page caching and data caching. A cache is primarily used to set expiration policies.
Given Information is all for Server Side.
Leave a Reply
Want to join the discussion?Feel free to contribute!