CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Raymond Lewallen

Framework Design, Agile Coach, President Oklahoma City Developers Group, Microsoft MVP C#, TDD, Continuous Integration, Patterns and Practices, Domain Driven Design, Speaker, VB.Net, C# and Sql Server

Viewstate chunking example in 2.0

Yesterday I talked briefly about Viewstate chunking. I am not aware of any publicly available resources or samples on view-state chunking. However, here’s an example of what chunking may look like (with a heavy emphasis on may):

<pages maxPageStateFieldlength="1000" .. >

Resultant page

<input type="hidden" name="__VIEWSTATEFIELDCOUNT" value="3" />
<input type="hidden" name="__VIEWSTATE" value =".." />
<input type="hidden" name="__VIEWSTATE1" value =".." />
<input type="hidden" name="__VIEWSTATE2" value =".." />

In this example, the page state is split into a number of fields. Since the size of the combined state is 3000, the page state is split into 3 hidden fields, along with a hidden field indicating the count of fields. Notice that each view-state chunk (after the first one) is appended with a count index.

Currently listening to: Shimmy - System of a Down



Comments

Scott Galloway said:

This is almost exactly what Paul Wilson does in the example I metioned in the comment to your previous post.
# February 23, 2005 2:40 PM

Raymond Lewallen said:

Yes it is Scott, except now you won't have to write all the code. It only takes one line, the maxPageStateFieldlength attribute, to be set and that's all there is to it. Maybe somebody on the MS team found Paul's post and implemented it into 2.0?
# February 24, 2005 4:41 AM

Scott Galloway said:

Ah, sorry, misunderstood! I thought you were planning to implement this yourself. I obviously failed to read the original post closely enough. Sorry!
# February 24, 2005 10:07 AM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add

About Raymond Lewallen

Working primarily in the public sector during his career, Raymond has designed and built several high profile enterprise level applications for all levels of the government. Raymond now works as a solutions architect for EMC. Raymond is an agile coach, Microsoft MVP C# and also president of the Oklahoma City Developers Group and Oklahoma Agile Developers Group. Raymond spends a lot of his time learning and teaching such things as Test Driven Development, Domain Driven Design, Design Patterns and Extreme Programming practices and principles, to name a few. Raymond is also an advocate of Alt.Net. Raymond is primarily a framework guy, so don't ask him anything about UI :) Check out Devlicio.us!