Hi,
I have bumped into a small issue regarding sending a JSON object to AjaxManager from client side javascript.
I'm trying to send this string representation of a JSON object:
Client side script calling ajaxRequest() thus:
where "args" is the JSON object.
Error message received when passing this JSON object:
This is the full error message I receive (excuse the Norwegian :P )
As you can see the JSON object has a nested array in it ('data':[...]). Are there limitations to the complexity of the JSON strings I can pass to ajaxRequest()?
The problem is circumvented by simplifying the JSON object to a flat structure; i.e.:
With same client side script above, there are no errors and everything works fine.
Is it possible to pass complex nested JSON objects as strings or can I only send flat structured {"key", "value", ...} type objects?
I'm using the lastes RadControls for ASP.NET Ajax (2009.2.701.35)
regards,
Ernst
I have bumped into a small issue regarding sending a JSON object to AjaxManager from client side javascript.
I'm trying to send this string representation of a JSON object:
{'cmd':'Rebind','data':[{'newid':5},{'newname':'test'}]} |
Client side script calling ajaxRequest() thus:
function refreshView(args) { |
var ajxmgr_id = '<%= RadAjaxManager.GetCurrent(Page).ClientID %>'; |
var oAjxMgr = $find(ajxmgr_id); |
var jsonArgs = JSON.stringify(args); |
oAjxMgr.ajaxRequest(jsonArgs); |
} |
Error message received when passing this JSON object:
Sys.WebForms.PageRequestManagerServerErrorException: Type System.String not supported for deserializing a matrix. |
This is the full error message I receive (excuse the Norwegian :P )
Detaljer om feil på webside |
Brukeragent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2) |
Tidsstempel: Fri, 17 Jul 2009 13:10:31 UTC |
Melding: Sys.WebForms.PageRequestManagerServerErrorException: Typen System.String støttes ikke for deserialisering av en matrise. |
Linje: 6 |
Tegn: 62099 |
Kode: 0 |
URI: http://localhost/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_scrmgr_HiddenField&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3ann-NO%3a0d787d5c-3903-4814-ad72-296cea810318%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2009.2.701.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3ann-NO%3a7e598a31-3beb-49a1-914c-5f530240f0ea%3a16e4e7cd%3a86526ba7%3aed16cbdc%3a11a04f7e%3af7645509%3a24ee1bba%3a1e771326%3aa7e79140%3a4cacbc31%3ae524c98b%3a874f8ea2%3a19620875%3a33108d14%3abd8f85e4%3a596d7b53%3a8674cba1%3aef347303%3ab7778d6c%3ac08e9f8a%3aa51ee93e%3a59462f1%3a63b115ed%3a1569bb5f%3adc7e0bd%3a1c565fc%3ac408cfaa |
As you can see the JSON object has a nested array in it ('data':[...]). Are there limitations to the complexity of the JSON strings I can pass to ajaxRequest()?
The problem is circumvented by simplifying the JSON object to a flat structure; i.e.:
{'cmd':'Rebind','newid':5,'newname':'test'} |
With same client side script above, there are no errors and everything works fine.
Is it possible to pass complex nested JSON objects as strings or can I only send flat structured {"key", "value", ...} type objects?
I'm using the lastes RadControls for ASP.NET Ajax (2009.2.701.35)
regards,
Ernst