asp.net - How to avoid System.ArgumentException: Invalid JSON primitive: new. when parsing json in c# -


i'm parsing json using microsoft json parser:

        var json = new javascriptserializer() { maxjsonlength = int.maxvalue };         return json.deserializeobject(jsonstr); 

when following json server:

[{"date_of_birth": new date("thu, 17 nov 1983 00:01:00 gmt")},{"date_of_birth": new date("wed, 23 nov 1904 00:01:01 gmt")}] 

it throws following exception:

system.argumentexception: invalid json primitive: new.    @ system.web.script.serialization.javascriptobjectdeserializer.deserializeprimitiveobject()    @ system.web.script.serialization.javascriptobjectdeserializer.deserializeinternal(int32 depth)    @ system.web.script.serialization.javascriptobjectdeserializer.deserializedictionary(int32 depth)    @ system.web.script.serialization.javascriptobjectdeserializer.deserializeinternal(int32 depth)    @ system.web.script.serialization.javascriptobjectdeserializer.deserializelist(int32 depth)    @ system.web.script.serialization.javascriptobjectdeserializer.deserializeinternal(int32 depth)    @ system.web.script.serialization.javascriptobjectdeserializer.basicdeserialize(string input, int32 depthlimit, javascriptserializer serializer)    @ system.web.script.serialization.javascriptserializer.deserialize(javascriptserializer serializer, string input, type type, int32 depthlimit)    @ system.web.script.serialization.javascriptserializer.deserializeobject(string input) 

how rid of this?


Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -

delphi - How to convert bitmaps to video? -