Just spent a lot of time exorcising asp.net's large (but understandably useful) viewstate from an app, and i think it's worth sharing how it's done.
Basically, i want this question to be open to all solutions for shrinking/compressing/removing viewstate.
Another better option, roll your own PageStatePersister. Here's mine, heavily inspired by http://aspalliance.com/72:
It's important at first to understand what the heck viewstate is and why you want it in the first place. After that, it's just a matter of being mindful of what the app is doing for you and remembering to attach the UseViewState="false" to all the elements that would normally use viewstate.
Now to remember why it's useful, you'll have a definite need to retrieve things more often manually.
A time and a place for all tools, yes?
Completely get rid of it:
One method that we have used in my company is to remove most of it by removing the
runat="server"
calls. Then we use javascript, or a good javascript library like jQuery or Prototype, to populate the HTML elements using ajax calls to the server.My boss did a lot of work with a website that had several megs of viewstate data. He used the above method and it "works great with no viewstate".
First easy option, use the built-in SessionPageStatePersister class. What this does is keep the viewstate on the session on the server, rather than sending it to the client. However, it still sends a smaller viewstate down so isn't all roses:
This method shrunk a particularly large postback from 100k to 80k. Not great, but a good start.
Switch to ASP.NET MVC! No ViewState!