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]]; 
1
  • What data structure are you serializing? Commented Jul 8, 2012 at 14:16

1 Answer 1

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?

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.