Last post Apr 12, 2011 06:21 AM by NihirPorecha
Apr 11, 2011 08:32 AM|RockyMtnHi|LINK
The VIEWSTATE size is killing our apps and it keeps growing. The .aspx files are bigger than 2.5Mb in some cases.
The developer is on vacation and I just installed a 90 day trial of VS 2008 to test turning form-level VIEWSTATE off then turning it on again to see if the VIEWSTATE gets reduced substantially. It didn't. It went right back to the same size.
When VIEWSTATE was off the page size was 650K. With it off I tested changing one combo field and it worked. The problem is that some pages are complicated with grids and custom user controls, so I am sure that disabling it can possibly affect whether some of
these fields work at all. Is this true?
Our server is Win Server 2008 Enterprise.
Any ideas to reduce the size of VIEWSTATE and keep the app running? I need to get this fixed today.
This is an extremely important app that people across the US are using, and any help is greatly appreciated.
Apr 11, 2011 08:51 AM|ignatandrei|LINK
If you modify something on ViewState, you will need re-test the whole page.
You can optimize size of the page if you tell IIS to send gzip. Also, you can cache some images / css /js.
But the ViewState can not be touched easily( and, next time, please consider ASP.NET MVC)
Apr 11, 2011 08:56 AM|V.Karthikeyan|LINK
No worries! :-) you can Compress Viewstates and decompress.. Check out this link..
Apr 12, 2011 04:30 AM|Dave Sussman|LINK
As stated, you can turn off viewstate, but you'd have to fully test the page to make sure it still worked. Most controls work without viewstate.
Having said that, even without viewstate, 650K is a pretty big page and 2.5Mb is huge. Really you should be looking at removing as much state from the page as possible if it's not required.
Apr 12, 2011 05:55 AM|sirdneo|LINK
If you are short in time then I do not recommend you to modify the code and enable/disable viewstate. Instead of this try saving viewstate in session or in some file at server. That will reduce your page size without effecting your code. For details see
In both above links you just need to make few changes in your project and all page's size will be reduced automatically. Later on when you find sufficent time to modify and test individual file, you can always remove unnecessory use of viewstate in your
Apr 12, 2011 06:21 AM|NihirPorecha|LINK