Support us .Net Basics C# SQL ASP.NET ADO.NET MVC Slides C# Programs Subscribe Buy DVD Application state - Part 67

Suggested Videos
Part 64 - Inporc session state mode management
Part 65 - StateServer session state mode management
Part 66 - SQLServer session state mode management

1. Application State variables are available across all pages and across all sessions. Application State variables are like multi-user global data.

2. Application State variables are stored on the web server.

3. Application State variables are cleared, only when the process hosting the application is restarted, that is when the application ends. 

4. Application State variables are not shared across a Web Farm or a Web Garden.

5. Application state variables are not thread safe. Lock and Unlock methods of the application class must be used to protect against race conditions, deadlocks, and access violations.
Application["GlobalVariable"] = (int)Application["GlobalVariable"] + 1;

Please Note: In this example, we are using application state variables to send data from one web form to another. If the requirement, is just to send data from webform to another, you should consider other alternatives.

6. Use application state variables only, when the variables need to have global access and when you need them for entire time, during the life time of an application. Cache object, can be used, as an alternative, if you need to have global access for a certain duration.

1 comment:

  1. Please share one video on How to use Cache Objects as one alternatives to Application State?


If you like this website, please share with your friends on facebook and Google+ and recommend us on google using the g+1 button on the top right hand corner.