Click here to Skip to main content
15,921,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Please tell me why and when to use session view state and application state in asp .net

1 solution

First I will provide you the following definitions from MSDN for them:

Session: Session variables are stored in a SessionStateItemCollection object that is exposed through the HttpContext.Session property. In an ASP.NET page, the current session variables are exposed through the Session property of the Page object.

More about Sessions:[^]

ViewState: Microsoft® ASP.NET view state, in a nutshell, is the technique used by an ASP.NET Web page to persist changes to the state of a Web Form across postbacks.

More about Viewstate:[^]

Application: You can use the Application object to share information among all users of a given application. An ASP-based application is defined as all the .asp files in a virtual directory and its subdirectories. Because the Application object can be shared by more than one user, there are Lock and Unlock methods to ensure that multiple users do not try to alter a property simultaneously.

More about Application:[^]

How to Choose From Viewstate, Session, Application, Cache, and Cookies:

Cache, Session, and ViewState: Cache, Session, and ViewState[^]

Hope this information helps you...
Share this answer
Smanish87 19-May-13 14:31pm    
Mohammed Hameed 19-May-13 14:49pm    

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900