I'm playing around with a asp.net page that's using the IScriptControl interface to pass data from the code-behind to the custom javascript object running on the browser.
I'm passing a number of properties via IScriptControl.GetScriptDescriptors(), and they're all working fine, except for one.
That one is a class derived from System.Collections.Generic.Dictionary<>. And even that one has been working for me, so long as the elements in the collection were scalars - ints, doubles, and strings. But when I tried to pass a member of a class, it showed up as a null object in the javascript. The class in question is marked [Serializable]. I changed it to a struct, and got the same behavior.
It looks as if the serializer used in IScriptControl does a shallow copy. I need a deep copy.
Any ideas?
Well, nobody else is answering this. This really isn't an answer, but the comment field is a little small.
I coded up a stupid little example, which at least looks like it works. What am I missing, what am I not doing that you are?
It causes this to be output to the page:
And here's the source: