开发者

How to convert json from one format to another

I have a control that expects JSON in 开发者_运维问答a particular format. I have a service that spits out JSON in a different format. What's the best way to convert the JSON to the expected format? C#, jQuery? I think I'd prefer to do it server-side.


With C# you can use System.Web.Script.Serialization.JavaScriptSerializer to parse your JSON string to an object or IDictionary.

MSDN: JavaScriptSerializer Class (System.Web.Script.Serialization)

With that object you could do anything you like, change values or maybe just parse it back to something like XML.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜