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
Posted

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: http://msdn.microsoft.com/en-us/library/ms178581(v=vs.100).aspx[^]


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: http://msdn.microsoft.com/en-us/library/ms972976.aspx[^]


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: http://msdn.microsoft.com/en-us/library/ms525360(v=vs.90).aspx[^]


How to Choose From Viewstate, Session, Application, Cache, and Cookies: http://www.articlesbase.com/programming-articles/how-to-choose-from-viewstate-session-application-cache-and-cookies-443393.html
[^]


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


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

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