How can I JSON encode an array in VB.NET?

pixeldev picture pixeldev · Feb 23, 2009 · Viewed 34.1k times · Source

I need to pass back a JSON result for a routine I am working with. In VB.NET, how can arrays be JSON encoded?

Answer

bdukes picture bdukes · Feb 23, 2009
Dim serializer as New JavaScriptSerializer()
Dim arrayJson as String = serializer.Serialize(myArray)