__VIEWSTATE data HUGE!!!

  • Thread starter Thread starter Shabam
  • Start date Start date
S

Shabam

I have an application being developed and I've noticed that in most of the
pages the __VIEWSTATE data is HUGE, about 4 pages full in many cases. This
leads to bloated page sizes upwards of 50KB and more.

My question is, is all that data really necessary in the page? When it has
that much, what does it mean? And how would one cut down on that?
 
Most ASP.NET controls, by default, place their state in the viewstate. A
large viewstate may indicate that there are some controls such as a calendar
that is included on the page that requires a lot of state management. If
you do not need viewstate on certain controls, then you can disable them by
placing the attribute EnableViewState="false" on those tags.
 
Hi,

For server controls that you don't need the view state for you can set their
EnableViewState property to false. Things like drop down lists and grids
and stuff use a lot of view state if they contain a lot of data. Setting
their propery to false should reduce your view state size a lot. Good luck!
Ken.
 
Back
Top