i need to return a JSON with this format:
{"answers": [{"id": "93", "value":"Ahstron"},
{"id"="94", "value"="Sampers"}]}
Im using the return Json() method form ASP MVC Framework, is there a way to specify that this JSOn is a collection of answers like in the sample code? or must i create my own?
with the
return Json(answers);
i just get this:
[{"id": "93", "value":"Ahstron"},
{"id"="94", "value"="Sampers"}]}
Try
return Json(new {answers = answers});
It almost worked, the correct syntax is:
return Json(new { answers = answers});
Thx a lot =)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With