The following JSON is not deserializing. It's obviously because the DECIMALS in the saves JSON. How do I fix this?
This initial JSON comes from the server and IS VALID:
{
"AppropriationAmount": 25000000,
"AppropriationHours": 56300,
"ArrThreshold": 11,
"ClientKey": 24,
"Description": 'Find and incarcerate the escaped prisoner',
"DirectHours": 50000,
"EndDate": '3/31/2011',
"EngineeringHours": 4000,
"IndirectHours": 2000,
"Key": 1589,
"Number": '0',
"OtherHours": 300,
"ProductivityCurveType": 'BurnedEarned',
"ProjectManager": 'Doctor Who',
"ProjectName": 'Prisoner ZERO',
"StartDate": '5/1/2010'
}
This subsequent JSON sent to the server FAILS:
Once the user edits the form, the data is serialized client-side and sent BACK...where it (then) fails upon attempting to de-serialize the JSON.
{
"AppropriationAmount": 56300.00,
"AppropriationHours": 25000000.00,
"ArrThreshold": 11.00,
"ClientKey": ,
"Description": 'Find and incarcerate the escaped prisoner',
"DirectHours": 50000.00,
"EndDate": '3/31/2011',
"EngineeringHours": 4000.00,
"IndirectHours": 2000.00,
"Key": 1589,
"Number": '0',
"OtherHours": 300.00,
"ProductivityCurveType": 'BurnedEarned',
"ProjectManager": 'Doctor Who',
"ProjectName": 'Prisoner ZERO',
"StartDate": '5/1/2010'
}
This code throws the Error:
try
{
if (!String.IsNullOrEmpty(this.JSON))
{
serializer = new JavaScriptSerializer();
dialog = serializer.Deserialize<ProjectDecorator>(this.JSON);
}
}
catch (Exception ex)
{
// The message shows here
}
The Error thrown looks like:
{"Invalid JSON primitive: ."}