Where is ViewState information stored?
Answer Posted / suresh.k
Storage Options
Because it implements the Provider Pattern, you have at your
disposal two ways of storing ViewState (with more to come):
* Save To Cache: save ViewState in Cache, on the server
* Save To XML: saves ViewState into an XML file on the
server
The storage option you choose, depends on your requirements
as well as the constraints of your hosting environment.
Save To Cache: it is recommended for those situations where
you have a moderate volume of visitors. Pages will be served
faster (since we are accessing memory to retrieve
information). Since Chache is recycled automatically by the
server when memory is needed, it is important to know what
your hosting provider memory limits are, and what volume of
users you expect at any given time.
The Cache solution, allows you to specify the number of idle
minutes that you want the viewstate to be kept in memory
before being recycled (cacheMinutes attribute).
In case of premature recycling, the page will not fail, but
be redirected to itself, thus instantiating a new caching cycle.
Save To XML: it is recommended for high volume sites. Pages
will be served fast, and viewstate stored and retrieved from
xml files saved in a directory of your choice (virtualPath
attribute) that will require r/w permission.
There will be one file per user, and files will be deleted
at a configurable interval (fileCacheMinutes attribute).
Since there could be multiple ViewState in any given file
(if for example a user opens a pop-up), you can also specify
the number of minutes that any given ViewState entry can be
idle before being deleted (recordCacheMinutes attribute). If
you have a lot of pop-ups in your site, recordCacheMinutes
should be set to few minutes.
In case of premature recycling, the page will not fail, but
be redirected to itself, thus instantiating a new caching
cycle.
| Is This Answer Correct ? | 5 Yes | 14 No |
Post New Answer View All Answers
Explain asp.net mvc request life cycle? : asp.net mvc
Are there any resources for drop-in replacements for the default css that comes with the ASP.NET Website template?
What is the difference between Session and response.Redirect?
Tell me the code snippet to show how we can return 404 errors from HttpError?
Describe the events in the life cycle of a web application.
What is autopostback in asp net?
Why mvc is faster than asp.net? : Asp.Net MVC
What is the use of HttpHandlers? When to use this?
What are the types of validation in asp net?
What is the difference between client-side and server-side validations in ASP.NET?
How to make paging concepts in datagrid in ASP.NET?
What is enableviewstatemac in asp net?
What is server components?
How would you implement inheritance using c#?
Explain the role of global.asax?