When the ViewState on your page becomes very large, this can be a problem, as some firewalls and proxies prevent access to pages containing huge ViewState sizes. For this purpose, ASP.NET introduces the ViewState Chunking engine. Thus, ASP.NET allows splitting one hidden ViewState field into several using the MaxPageStateFieldLength property in the web.config section.
If the MaxPageStateFieldLength property is set to a positive number, the view state sent to the clientβs browser is broken into several hidden fields.
Setting the MaxPageStateFieldLength property to a negative number (default) means that the view state field should not be split into pieces. Setting MaxPageStateFieldLength to a small number may result in poor performance.
ViewState example before:
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"value="/wEPDwUKLTk2Njk3OTQxNg9kFgICAw9kFgICCQ88KwANAGQYAQUJR3Jp ZFZpZXcxD2dk4sjERFfnDXV/hMFGAL10HQUnZbk=" />
Then install in web.config:
<pages maxPageStateFieldLength="40">
ViewState After example:
<input type="hidden" name="__VIEWSTATEFIELDCOUNT" id="__VIEWSTATEFIELDCOUNT"value="3" /> <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKLTk2Njk3OTQxNg9kFgICAw9kFgICCQ88" /> <input type="hidden" name="__VIEWSTATE1" id="__VIEWSTATE1" value="KwANAGQYAQUJR3JpZFZpZXcxD2dk4sjERFfnDXV/" /> <input type="hidden" name="__VIEWSTATE2" id="__VIEWSTATE2" value="hMFGAL10HQUnZbk=" />
Hope this helps you!
kril Sep 05 '12 at 19:27 2012-09-05 19:27
source share