PDA

View Full Version : [CLOSED] AjaxResult Compatibility issue with JQ



cleve
Dec 16, 2012, 1:35 PM
Hi there,

I proudly built my server-side mvc actions using Ext.net.MVC.AjaxResult (return result).
I thought they should be compatible if I use JQ.ajax() to cope with them.
Now comes the first question:

AjaxResult() returns json formatted with no quote on property names. like "{ success: true }"
Can I do something to intentionally specify AjaxResult to return json string with property name quoted, like "{ "success":true }" ?

Daniil
Dec 17, 2012, 5:30 AM
Hi @cleve,

Yes, we recently discovered (due to another forum thread) that jQuery doesn't work with such JSON without quotes. Honestly, it was a surprise.

Generally, AjaxResult has been designed to be used with Ext.NET DirectEvents and DirectMethods only. It works with a JSON without quotes.

Unfortunately, there is no option to get these quotes in a response.

But I will discuss with my colleagues a possibility to get it. An option or just serialize everything with quotes.

Daniil
Dec 18, 2012, 8:43 AM
But I will discuss with my colleagues a possibility to get it. An option or just serialize everything with quotes.

We made the change in the ClientConfig class. Now it quotes properties. It affects on the AjaxResult/DirectResult classes as well.

Since now we are going to serialize everything with quotes.

Thank you for the question.