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.

Table 7.3. State Management Options Compared (Part 1)
 View StateQuery StringCustom Coookies
Allowed Data TypesAll serializable .NET data types.A limited amount of string data.String data.
Storage LocationA 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).
LifetimeRetained 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.