__VIEWSTATE data HUGE!!!

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?
 
P

Peter Rilling

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.
 
K

Ken Dopierala Jr.

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top