hi,
I am passing an array from view to the controller using json.stringify() method.
That value is passing to the controller and that is in
"\"[{\\\"id\\\":1 "id\\\":2}]\"" format.I think this is in json format,I want to convert this into {id:1,id:2} format.
I tried to convert this into string format using JsonConvert.serailizeObject(),
but it is displaying in "\"\\\"[{\\\\\\\"id\\\\\\\":1}]\\\"\""format.
can u tell me how can i convert into integer format
Loading
Nattudurai EswaramurthyPosted Aug 16, 2012, 5:57 AM
Use the JSON reader object to read the item, then convert it to specific type(integer) whihc you want.
JsonReader reader = new JsonReader(new JsonReaderConfig() { { setTotalProperty("results"); // The property which contains the total dataset size (optional) setRoot("rows"); // The property which contains an Array of row objects setId("id"); // The property within each row object that provides an ID for the record (optional) }}
Please mark this answer as accepted answer if it resolves your problem.