The viewstate of a standard page can be 10k to 50k, a complex page can reach to 500k. This field is send to the server and send back to the client each time the client does a postback, reducing the size will increase the global application speed.
With the encryption you can add a new layer of security, because, by default, the data stored on the viewstate can be easily read
You can prepare the component to use in two ways: 1.- Link the attached project "VSCompressor.vbproj" to your web application. 2.- Copy the files "VSCompressor.vb", "VSCompressorException.vb" and "VSCPage.vb" to the app_code folder in your web application.
For enable the component on a page you must change the super class of this page, instead of the default System.Web.UI.Page, the page class must inherit from VSCPage
This is the default code:
Partial Class _Default Inherits System.Web.UI.Page
In case you linked the project:
Partial Class _Default Inherits VSCompressor.VSCPage
And if you copied the files to app_code folder:
Partial Class _Default Inherits VSCPage
Finally, by default the compression and encryption are disable, you must add two keys into the appSettings node on the web.config.file to control the behavior of the component