Managing Persistent User State in Your ASP.NET

Posted by Unknown

Managing Persistent User State in Your ASP.NET

In this post i want to give very simple  and clear information about state management  in asp.net.
ASP.net Provides different ways managing states between the user requests.
There are nine ways to manage state in asp.net those are


Here is simple differentiation between these nine state management ways

Persistence MethodWho Needs the Data?For How Long?How Much Data?
ApplicationAll usersUntil the next application restartCan be almost any size—it will only be stored once
CookieOne userAs short as desired, or for months or even years if the user doesn't delete their cookiesMinimal, simple data
Form PostOne userFor the next request (can be reused across many requests)Virtually any size—the data is sent back and forth with every page
QueryStringOne user or one group of usersFor the next request (can be reused across many requests)Minimal, simple data
SessionOne userAs long as the user is active, plus a timeout period (typically 20 minutes)Can be almost any size, but should be minimized since every user has their own separate session store
CacheAll users or a subset of usersAs long or as short as neededCan be used for large or small, simple or complex data
ContextOne userThis request onlyCan hold large objects, but typically does not since it is often used for every request 
ViewStateOne userOne Web formMinimal; as with Form Post, this data is sent back and forth with every page
Config fileAll usersUntil the configuration file is updatedCan hold a lot of data; usually organized as many small strings or XML structures
Hope this will helps you
Labels: , ,

Post a Comment

 
test