Click here to Skip to main content
15,917,652 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi,
I'm learning and practicing on asp.net state management.
can you please provide me some basic and simple examples of state-management (sessions , cookies, query string , view state and application management).

thank you...,
Posted
Comments
[no name] 24-Jun-13 9:29am    
http://lmgtfy.com/?q=asp.net+state+management

1 solution

Client Side:
View State – Asp.Net uses View State to track the values in the Controls. You can add custom values to the view state. It is used by the Asp.net page framework to automatically save the values of the page and of each control just prior to rendering to the page. When the page is posted, one of the first tasks performed by page processing is to restore view state.
Control State – If you create a custom control that requires view state to work properly, you should use control state to ensure other developers don’t break your control by disabling view state.
Hidden fields – Like view state, hidden fields store data in an HTML form without displaying it in the user's browser. The data is available only when the form is processed.
Cookies – Cookies store a value in the user's browser that the browser sends with every page request to the same server. Cookies are the best way to store state data that must be available for multiple Web pages on a web site.
Query Strings - Query strings store values in the URL that are visible to the user. Use query strings when you want a user to be able to e-mail or instant message state data with a URL.

Server Side:
Application State - Application State information is available to all pages, regardless of which user requests a page.
Session State – Session State information is available to all pages opened by a user during a single visit.
Both application state and session state information is lost when the application restarts. To persist user data between application restarts, you can store it using profile properties.

You can get more detailed description over MSDN: ASP.NET State Management Overview[^]

Also check out these CP articles:
Beginners Introduction to State Management Techniques in ASP.NET[^]
State management and ways to handle Cache in a Web Farm/Web Garden scenario[^]
Beginner's Guide To View State [^]
A Walkthrough to Application State[^]
State Management[^]
 
Share this answer
 

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