HLRosenberger
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?
javascripterror1.png
javascripterror.png
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?
javascripterror1.png
javascripterror.png
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks.
Did you mean to give the B grade?
The grading system is a bit different here, have a look at this: http://support.experts-exchange.com/customer/portal/articles/481419-what-grade-should-i-award-
The grading system is a bit different here, have a look at this: http://support.experts-exchange.com/customer/portal/articles/481419-what-grade-should-i-award-
ASKER
http://stackoverflow.com/questions/925553/cannot-serialize-object-to-viewstate-only-session
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?