Asp.Net has some options to influence the ways a page its ViewState is generated (encryption, adding of a mac, ViewStateUserKey).
I would like to do it myself, not based on configuration, but on my own class that used other algorithms for serialization and encryption. Is this possible?
Yes you need to implement your own PageStatePersister class. The MSDN page shows you an example of how it works.
We had a rather large ViewState we offloaded to the file system and replaced it with a much more compact GUID on the actual page.
Yes, it's possible. For instance, I built a view state compression logic based on some articles you can find on CodeProject. You'll need to override
PageStatePersister
fromPage
and create a class derivated fromPageStatePersister
:And create a new class: