ASP.NET offers a number of places to store state, both on the client and server. However, sometimes it's difficult to decide where you should put things and how to make that decision.
You choices for state management include:
- Application - Stored on the server and shared for all users. Does not expire. Deprecated by Cache (below).
- Cache - Stored on the server and shared for all users. Can expire.
- Session - Stored on the server. Unique for each user. Can expire.
- ViewState - Stored in a hidden page input (by default). Does not expire.
- Cookies - Stored at the client. Can expire.
- QueryString - Passed in the URL. Must be maintained with each request.
- Context.Items - Only lasts for one request's lifetime. More.
- Profile - Stores the data in the database. Can be used to retain user data over multiple request and session.
Whitepapers/Blogs
Videos
Enjoy! Be sure to explore the sub-topics.
Revision number 9, Saturday, February 27, 2010 8:55:59 AM by mbanavige
You must Login to comment.
|
Mon, Oct 6, 2008 6:53 AM
by uniquesaiful
|
Cool main page for state management
|
|
Tue, Nov 18, 2008 3:31 AM
by cliquerz
|
Nice 1
|
|
Fri, Feb 27, 2009 11:58 PM
by haitham.elrefaie
|
nice article to mention all the state management types in one place...
|
|
Mon, Mar 2, 2009 4:56 AM
by sunilyadav165
|
Great work !!!
|
|
Thu, Mar 12, 2009 5:13 PM
by Grady Christie
|
Great introduction on the topic!! Very informative.
|
|
Tue, Mar 24, 2009 2:50 AM
by devadkarramesh
|
nice
|
New
Thu, Apr 8, 2010 10:20 PM
by roopeshreddy
|
Maintaining the Session Id through out the Session
Hi, Many of us come across situation like, just need a unique session id through out the session irrespective of whether the data is stored in the session or not. If you just write like, String strSessionId = Session.SessionId; It will fectch the Unique session
|
Revision #3
Tue, Apr 27, 2010 9:13 PM
by Jalpesh P. Vadgama
|
ASP.NET and Load balancing.
In one of our project the site usage of site was very heavy and we need to migrate it to load balancing server. I have never configured the sites in the load balancing server but it was quite interspersing experience Here are the some points which we need
|
New
Thu, Feb 17, 2011 7:27 PM
by durga89
|
How Sessions Time Out....?
I wonder some times how statemanagement efficiently helps a developer to handle the user sessions. Session state management is one which should be handled with care, Other wise it can create various problems. We have to identify how are these sessions expire
|
Revision #3
Wed, Apr 27, 2011 6:27 PM
by ganaparthi
|
Maximum length of Querystring in ASP.NET
Maximum length of Querystring is based on the browser not depend upon the asp.net. here is some information Maximum length of a querystring in IE 4.0 and above is ~2048 characters IE. 4,5,6,7, - 2,048 characters. Opera supports - 4050 characters. Netscape
|
Revision #12
Thu, Aug 23, 2012 10:09 AM
by kunal.goel
|
Session
ASP.NET Session state provides a place to storevalues that will persist across page requests. Valuesstored in Session are stored on the server andwill remain in memory until they are explicitly removed or until the Session expires. Storing and retrievinga
|
Revision #12
Fri, Jul 8, 2011 12:55 AM
by scngan
|
ViewState
ViewStateis the mechanism that allows state values to be preserved across page postbacks. Because of the stateless nature of web pages, regular page membervariables will not maintain their values across postbacks. When we need a page variable to maintain its
|
Revision #6
Mon, Feb 4, 2008 8:00 AM
by aspsmith
|
Application and Cache
The Cache and Application objects provide broader scope than the Session object and the data is available to all the classes within theASP.NET application. The Basics ASP.NET Application State Overview ASP.NET Caching Overview How to: Save Values in Application
|
Revision #5
Fri, May 23, 2008 8:17 AM
by XIII
|
Cookies
Cookies are small amounts of text that can be stored on the client pc by the browser. The cookie can be accessed both at the client through the use of Javascript and also at the server. While cookies can be a convenient way to store small bits of state information
|