State Management in ASP.NET

Hi Everybody,

I am once back with a blog/article/tutorial whatever you think/call it.

State Management in ASP.NET :

HTTP Protocol is State less protocol. In Simple Language, Each and Every time We send a request to server, this is New to server.

To Understand this ,Suppose you took One Textbox and Two Buttons like in Image below:

Now, the task is To Enter Number in Textbox and Click in First Button to Convert to Integer format and then Click Second button to Print Square of Converted Integer in Textbox. What will you do. Lets look at code what I did here.

Now what would I get Result on Second Button Click event. Textbox Result will be 0 even I have entered any number. Don’t agree, try this at home.

This is Because, at the time of Button2 Click new request is send to server and Initial Value of X is picked from server which is 0.

To Prevent the Loose of Data each time we send request to server, ASP.NET have implemented concept of State Management.

State Management is divided into 2 parts according to Functionality.

1) User Based State Management in ASP.NET

  • Cookies
  • QueryStrings
  • ViewState
  • Controls
  • Hidden Fields

2) Server Based State Management in ASP.NET

  • Session
  • Application
  • Profile

I am going to Describe all these States step by step in Different Posts.

All the Series has been posted on DotNetSpider at below Link Resources > Keep Reading.

Have any Question or Comment?

Leave a Reply

Your email address will not be published. Required fields are marked *