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?
javascripterror1.png
javascripterror.png
ASP.NETVisual Basic.NETVisual C++.NET

Avatar of undefined
Last Comment
Rob

8/22/2022 - Mon
ASKER
HLRosenberger

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

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?
ASKER CERTIFIED SOLUTION
Rob

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
HLRosenberger

Thanks.
Rob

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-
Your help has saved me hundreds of hours of internet surfing.
fblack61