Michael Schwarz wrote: > the problem is the use of the type "object". If I get a [1,2,3,4,5] > json string what data type should it be? int[] long[] double[] ...?
Well, your component should use the simplest one that makes sense, IMO. i.e. you attempt to coerce the JSON data to and int (call int.TryParse()) and if that doesn't work, try a long, etc. until it converts without a problem, and if all of those fail, then just pass it as a string array. I don't know, maybe I am not thinking it through all the way, but this seems to me to a no-brainer. Besides, can't you safely assume that if the server-side method accepts an int[][], that you should be able to convert the JSON data to that data type? If it fails, the developer will just have to know what is going on. I mean, I know I am passing an array of integer arrays, so if I use the wrong data type on my server-side method, that is my problem. This seems like a no-brainer to me, but maybe I am not thinking it through all the way.... > You can use: > public int SaveData(int[] analysisElementValues) That doesn't seem to be working for me. The server-side method never gets called and I don't get any error messages from your component. > Or... > public int SaveData(IJavaScriptObject analysisElementValues) > public int SaveData(JavaScriptArray analysisElementValues) Don't really want to use those, since they are your objects and again, I just don't see why a regular int[][] will not work.... --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
