Link to home
Start Free TrialLog in
Avatar of HLRosenberger
HLRosenbergerFlag for United States of America

asked on

Javascript Serialization Error

I'm save and restoring an object across postbacks using ViewState, like this:

So I save it using ViewState like this:

ViewState("MyObject") = object

and retrieve it like this:

Return ViewState("MyObject")

Since this is an object, I assume .NET is trying to serialize it.

I am getting a javascript serialization error.  See images.

I'm at a total loss.  Any ideas on this?
Avatar of HLRosenberger
Flag of United States of America image


I found this article.  When I use Session to save/restore my object, all is OK. 

Could anyone expand on this?  I'm not an expert at serialization and I'm trying to understand.   I really want to use ViewState, not Session.   Can I serialize the object myself using BinaryFormatter and then save to ViewState?
Avatar of Rob
Flag of Australia image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Did you mean to give the B grade?
The grading system is a bit different here, have a look at this: