7.8. An Overview of State Management Choices
Each state management choice has a different lifetime, scope, performance overhead, and level of support. Table 7-3 and Table 7-4 show an at-a-glance comparison of your state management options.
View State | Query String | Custom Coookies | |
---|---|---|---|
Allowed Data Types | All serializable .NET data types. | A limited amount of string data. | String data. |
Storage Location | A hidden field in the current web page. | The browser's URL string. | The client's computer (in memory or a small text file, depending on its lifetime settings). |
Lifetime | Retained permanently for postbacks to a single page. | Lost when the user enters a new URL or closes the browser. However, this can be stored in a bookmark. ... |
Get Beginning ASP.NET 3.5 in C# 2008: From Novice to Professional, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.