David,
The reason you get a security exception is because the viewstate is
encrypted (I believe), and when you write information to it without
encrypting it with the proper key, it realizes that the state has been
tampered with.
What you need to do is create a hidden input field, and then set the
contents of that with your data that you wish to save. You can then read
that on the server side and save it where you need to.
Hope this helps.

Signature
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
> All or Anyone:
>
[quoted text clipped - 10 lines]
>
> Thanks in advance.