State Management in ASP.Net:

Introduction:


In this article we willdiscuss about state management techniques in Asp.Net.Generally Browsers are always stateless .The browser communicate with the server using HTTP Protocol. As we all know HTML is a stateless language.

Here, stateless means whenever we visit a website, our browser communicate with the respective server depends upon our request.It means that web server does not have any idea about the requests from where they coming .That means from same client or new clients. On each request web pages are created and destroyed.

So every Web Application needs to maintain state in one way. To overcome this situation Asp.Net provides state management technique.

Types of State management Technique:

 Asp.net Technology provides two types of state management technique.
  • Client side state management
  • Server side state management

Client Side State Management:

              The webpage related information will directly get stored in client side that is clients computer. For these options, no information is maintained on the server between round trips.

Client Side State Management Techniques are:
  • View State
  • Hidden field
  • Cookies
  • Query Strings

View State:

Asp.Net uses View State to track the values in the Controls. You can add custom values to the view state. View state is automatically maintained across posts by the ASP.Net framework. ASP.NET which is used to store small amounts of data on the client.

Hidden field:

Hidden field is a control provided by ASP.NET which is used to store small amounts of data on the client. It store one value for the variable and it is a preferable way when a variable's value is changed frequently.A hidden field travels with every request like a standard control’s value.

Cookies:

A set of Cookies is a small text file that is stored in the user's hard drive using the client's browser. Cookies are just used for the sake of the user's identity matching as it only stores information such as sessions id's, some frequent navigation or post-back request objects.

Query Strings:

 Query string is the limited way to pass information to the web server while navigating from one page to another page. This information is passed in url of the request.

Server Side State Management:

Asp.net provides some options to implement server side state management. Server-side options are more secure.Server Side State Management techniques are:

  •  Application State
  •  Session State Application

Application state:

Application state is stored in the memory of the windows process which is processing user requests on the web server.This state is very useful for storing information that needs to be maintained between server round trips and between requests for pages.

Session State:

A session is defined as the period of time that a unique user interacts with a Web application Session management is a  strong technique to maintain state in Asp.net. Session state is stored in the Session key or value dictionary.

Latest Updated ASP.NET MVC Training Topics (Free PDF)



Comments

Popular posts from this blog

Top25 ASP.NET Interview Questions - FAQ | Crack the Interview Easily

Top 100 Microsoft Dot Net Interview Questions with Answers

Important Tools For Dot NET Development