Is there a built in way in .Net AJAX to manually serialize an object to a JSON string?

前端 未结 6 1491
清歌不尽
清歌不尽 2021-02-05 21:33

I\'ve found ScriptingJsonSerializationSection but I\'m not sure how to use it. I could write a function to convert the object to a JSON string manually, but since .Net can do it

6条回答
  •  借酒劲吻你
    2021-02-05 21:51

    This should do the trick

    Dim jsonSerialiser As New System.Web.Script.Serialization.JavaScriptSerializer
    Dim jsonString as String = jsonSerialiser.Serialize(yourObject)
    

提交回复
热议问题