Optimizing ViewState

  • Thread starter Thread starter Ben Fidge
  • Start date Start date
Ben,
The question is on the vague side. Turn on tracing, see what's using
viewstate and see if you can make it work without. if your page doesn't
postback, you can turn viewstate off at the page level.

Check out Scott Guthrie's deck on performance
http://scottgu.com/PerformanceEurope.zip it touches briefly on viewstate.

A nice compression module can help mitigate the performance issues around
round-triping large viewstate
(http://www.blowery.org/code/HttpCompressionModule.html)

Karl
 
Thanks Karl,

I'll have a look.

Ben


Karl Seguin said:
Ben,
The question is on the vague side. Turn on tracing, see what's using
viewstate and see if you can make it work without. if your page doesn't
postback, you can turn viewstate off at the page level.

Check out Scott Guthrie's deck on performance
http://scottgu.com/PerformanceEurope.zip it touches briefly on viewstate.

A nice compression module can help mitigate the performance issues around
round-triping large viewstate
(http://www.blowery.org/code/HttpCompressionModule.html)

Karl
 
Things that will considerably reduce your viewstate size :-

1) Disable viewstate for those controls that are going to get populated
everytime a page loads.
2) Disable viewstate for the page if the page does not postback to itself.
3) Viewstate can store a type that either is serializable or has a
TypeConverter defined for it can be persisted in ViewState. However, types
that are only serializable are slower and generate a much LARGER ViewState.
Hence reduce the number of only serializable types.


Best of Luck
 
Back
Top