Compressing ASP.NET 2.0 ViewState

More optimized and compressed ViewState is one of the major improvements in ASP.NET 2.0. Remember those days, when you placed a paginated DataGrid on page only to discover later that enormous ViewState reluctantly generated inside your page. Now in ASP.NET 2.0, you may have noticed comparatively smaller ViewState. How about moving one step more to further decrease payload of the page, by compressing ViewState before rendering it to page?

Here is the small tutorial on compressing ViewState in ASP.NET 2.0: Compressing ASP.NET 2.0 ViewState

By compressing ViewState, as mentioned in test case, you can reduce the size ViewState from 43.3 kb to 3.50 kb. Now this is major performance improvement with no requirement to modify any implementation in your application. All you have to do is to change base class of pages in question (like page with DataGrid, or page with lots of dynamic controls etc.) from System.Web.UI.Page to PageViewStateZip, and that's all.