Thursday, April 18, 2013

MaxPageStateFieldLength

I have never used this property, however it's good to know.
MaxPageStateFieldLength specifies the maximum bytes that the view state can be placed in one hidden field. If the view state is larger than the value of  maxPageStateFieldLength, the view state will  be separated into several hidden fields automatically.

Setting the MaxPageStateFieldLength property to a negative number (the default is -1) indicates that the viewstate field should not be separated into chunks. Setting the MaxPageStateFieldLength to a small number may result in poor performance.

The benefit of this feature is that some proxies and firewalls will deny access to the aspx page that contains a huge ViewState size. So by enabling the viewstate chunking mechanism will allow you to bypass this policy.

In Web.Config:
<pages maxPageStateFieldLength="10">

No comments:

Post a Comment