日期:2014-05-17  浏览次数:20393 次

MVC4中怎样将一个字符串转换成JSON格式?
本帖最后由 siaosa 于 2013-07-25 13:56:39 编辑
有字符串
string m="{total: 17,page: 1,records: 17,  rows : [ {id:'1', cell:[ '1','FG001','SFG001','1.000000','2013-04-02 0:00:00' ] } ] }";

现在如何将这个字符串转换成JavaScript识别的JSON格式啊? 要求是在后台转

------解决方案--------------------
string m="{\"total\": 17,\"page\": 1,\"records\": 17,  
\"rows\": [{\"id\":1, \"cell\":[ \"1\",\"FG001\",\"SFG001\",\"1.000000\",\"2013-04-02 0:00:00\"]} ]}";