Hi,

do you have any child-parent relation in your objects? This will
currently end in an StackOverflowException. You could write your own
serializer to do this...

On more: why do you want to return a JSON string instead of the JSON
object itself?

Regards,
Michael



On 10/3/06, dimkaspb <[EMAIL PROTECTED]> wrote:
>
> To clarify my problema bit, I am getting the following error running a
> method that returns my custom class: "JIT Debugging failed with the
> following error: Access is denied.".
>
> All I do is I create my custom object, load it from a database and
> serialize it to return a json string back to client-side:
>
> [AjaxPro.AjaxMethod()]
> public string AjaxLoadMyClass(int pk)
> {
>  MyClass obj = new MyClass();
>  obj.Load(pk);
>  // i suspect a problem lies in the line below
>  string json = AjaxPro.JavaScriptSerializer.Serialize(myObject);
>  return json;
> }
>
> When I step through the code in the debugger, it freezes when it gets
> to the AjaxPro.JavaScriptSerializer.Serialize() method execution...
>
> Do I need to write a converter class for MyClass?
>
> Thanks,
> Dima
>
>
> >
>


-- 
Best regards | Schöne Grüße
Michael

Microsoft MVP - Most Valuable Professional
Microsoft MCAD - Certified Application Developer

http://weblogs.asp.net/mschwarz/
http://www.schwarz-interactive.de/

Skype: callto:schwarz-interactive
MSN IM: [EMAIL PROTECTED]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Ajax.NET Professional" group.

To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]

For more options, visit this group at http://groups.google.com/group/ajaxpro

The latest downloads of Ajax.NET Professional can be found at 
http://www.ajaxpro.info/

Don't forget to read my blog at http://weblogs.asp.net/mschwarz/
-~----------~----~----~----~------~----~------~--~---

Reply via email to