Question

I am using Telerik controls in my webforms and want to serialize object on the client. Since I am getting a stackoverflow error with Sys.Serialization.JavaScriptSerializer.deserialize I wanted to try JSON. With both JSON and and the MS library I get "Sys.Application is undefined."

Has anyone encountered this what did you do as a work around?

EDIT

I am serializing my object on a parent page and passing them via an argument to a child window. The child window is in an IFRAME tag. The object can be used in the child page, but I receive the stackoverflow error when I serialize it. The object is an Array of objects.

Was it helpful?

Solution

I may have a work around. On the parent page I do the following:

        //  Call Dialog Window                
        var radWindow = window.radopen(null, "DialogWindow");
        var args = new Object();

        //  Assign DisplayValues            
        args.serialPairs = Sys.Serialization.JavaScriptSerializer.serialize(jsonDataValuePairs);

        radWindow.argument = args;
        radWindow.SetUrl("AssignCCMProfile.aspx?CCMId=" + ccmId + "&ExecDate=" + execDate);
        radWindow.Center();
        radWindow.Show();  

On the child page I do the following:

dataValuePairs = Sys.Serialization.JavaScriptSerializer.deserialize(args.serialPairs);          

This seems like a kluge to me. It works, but I'd rather pass the object from the parent window to the child window and still be able to serialize the object on the child window.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top