0

I am using JavaScriptSerializer for a list - and it works:

string codeString = (new JavaScriptSerializer()).Serialize(ramGraphList);

Although the output is formatted as follows:

[["Time","Value"],["08/07/2012 12:43:28","5270"],["08/07/2012 12:44:32","5277"]]; 

The problem is that the values "5270" and "5277" are not strings, they should be treated as int's hence they have to be unquoted.

Is there an effective way of achieve this?

Expected output:

[["Time","Value"],["08/07/2012 12:43:28",5270],["08/07/2012 12:44:32",5277]]; 
Mark
  • 63
  • 6

1 Answers1

0

I believe that it's not possible to do this with the JavaScriptSerializer class without wraping it or modifying the class. However, have you considered using DataContractJsonSerializer or JSON.Net?

Allov
  • 1,308
  • 1
  • 13
  • 23