Large ViewState & ViewState chunking (maxPageStateFieldLength)

The ViewState Chunking mechanism allow you to split the ViewState content into several chunks/hidden fields. The reason behind using this feature is that some proxies and firewalls will deny access to the aspx page that contains a huge ViewState size by enabling the chunking mechanism that will allow you to bypass this policy.

You can enable ViewState chunking by setting the MaxPageStateFieldLength property the web.config of your asp.net application, this property should be added to the "pages" section in the web.config and it will specify the maximum size of the ViewState in bytes.

If the ViewState size is larger than the value of the MaxPageStateFieldLength than it will be splitted automatically into several hidden fields.

Set the property in the web.config as per the following:
<pages maxPageStateFieldLength="5">

ViewState Example:

Note that you should reconsider the way you are using the ViewState (ViewState optimization, maybe disabling it in some cases) when it has large size.

Reference:
http://msdn.microsoft.com/en-us/library/ms178577%28v=vs.85%29.aspx

Published Saturday, July 09, 2011 9:14 AM by jhallal

Comments

# Large ViewState & ViewState chunking... | ASP.NET, .NET and Ajax | Syngu

Pingback from  Large ViewState & ViewState chunking... | ASP.NET, .NET and Ajax | Syngu

# re: Large ViewState & ViewState chunking (maxPageStateFieldLength)

Sunday, July 17, 2011 9:11 PM by Cheap Chanel

Thank you for sharing this article.

# re: Large ViewState & ViewState chunking (maxPageStateFieldLength)

Monday, July 18, 2011 8:30 PM by Mike

i like your blog very much.Thanks for sharing information.

# re: Large ViewState & ViewState chunking (maxPageStateFieldLength)

Monday, January 07, 2013 9:10 AM by Escobar

I have recently started a blog, and the info you

give away on this website has helped me very much. Thanx for

all of your time & work.

Leave a Comment

(required) 
(required) 
(optional)
(required)