views:

178

answers:

2

I have:

Function SaveAnswers(ByVal collection As FormCollection) As ActionResult

End Funciton

And I want to turn collection to JSON, I thought there was a serializer to do this but can't seem to find it?

+1  A: 

NewtonSoft.JSON

http://james.newtonking.com/pages/json-net.aspx

Rodrigo
I was looking at that, was hoping there was something already baked in
Slee
A: 

There is. In c#:

return Json(object/array/whatever);

It returns a JsonResult, which is an ActionResult, so it "fits" into your function as it exists already.

James

James S