Raymond Lewallen

Sponsors

The Lounge

Wicked Cool Jobs

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
Viewstate chunking
I was away from my computer all weekend, so I'm playing a bit of catchup today on my blog posts. There is no direct upper limit on the size of a viewstate. Limitations come into play when the browser limits the size of hidden fields. A capability to look for in Whidbey is chunking view-state. This is intended for situations where the view-state field becomes very large and certain firewalls or proxies may prevent a page if a hidden field is considered to be too big. In this case, a developer will be able to configure the view-state so it can be broken into multiple hidden fields. This is accomplished by the developer providing a cut-off size for a single view-state field. The cut-off size will have no upper or lower limit, although setting the cut-off to be very low will hurt performance. This can be valuable when dealing with large datasets bound to datagrids and other instances where you get a very large viewstate. Be aware though, this chunking capability doesn't replace the fact that viewstates should be kept as small as possible, and even turned off where applicable.

Currently listening to: Heartcatchthump - Chainsaw Kittens

Posted Tue, Feb 22 2005 6:39 AM by Raymond Lewallen
Filed under:

[Advertisement]

Comments

Brendan Tompkins wrote re: Viewstate chunking
on Tue, Feb 22 2005 6:46 AM
I can see the need for this, but don't you think any app needing to chunk the viewstate has some, well, design issues? I guess I'd just recommend that other state mechanisms are explored before cramming it all in a huge ViewState.
Raymond Lewallen wrote re: Viewstate chunking
on Tue, Feb 22 2005 7:08 AM
I absolutely agree, Brendan. That's why I stated "...chunking capability doesn't replace the fact that viewstates should be kept as small as possible...". However, there has been enough concern over it in the last 3 years that Microsoft implemented chunking. I don't know what each browsers limitation on hidden field size is, and have not run into this problem, yet, that I know of. I do have some very large datagrids though, and anticipate that there are some users out there that may be experiencing a problem and not reporting it.
Brendan Tompkins wrote re: Viewstate chunking
on Tue, Feb 22 2005 8:33 AM
Okay, good! :) I just have gone viewstate crazy in the past, because it was so easy to do. It came back to bite me... Most of my bloated viewstate stuff was due to datagrids. I've ended up turning viewstate off, and managing it on the server, which isn't the easiest thing in the world to do. I wonder if a post on how to do this would be useful.
Raymond Lewallen wrote re: Viewstate chunking
on Tue, Feb 22 2005 8:35 AM
Already working on the post to demonstrate viewstate chunking ;)
Scott Galloway wrote re: Viewstate chunking
on Tue, Feb 22 2005 8:47 AM
Raymond- check out Paul Wilson's stuff on this http://weblogs.asp.net/pwilson/archive/2003/08/21/24867.aspx
Personally I've switched a couple of recent apps to using some Server Side Viewstate stuff I wrote (with background cleanup bits) - gets the advantages of ViewState without the hassle of custom state management (and without the memory implications of Cache, statics etc...)
TrackBack wrote Viewstate chunking example in 2.0
on Wed, Feb 23 2005 12:33 PM

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Devlicio.us