JSON.NET 主页下载 和  帮助文档

将下载的DLL,XML和***放入bin中,然后在解决方案中添加.NET以用。就可以使用了。

服务器端:
List list = new List();
                 for ( int i = 1; i <= 6; i++)
                {
                        TechnologyObject technologyObject = new TechnologyObject();
                        technologyObject.m_carTimes = i.ToString();
                  
                        list.Add(technologyObject);
                }
                 string json = JsonConvert.SerializeObject(list, Formatting.Indented);
                Response.ContentType = "application/json";
                 string backjson = "{'root': " + json + "}";
                Response.Write(backjson);


JS端:
// 发送数据请求
        $.post("Ajax.aspx", { Action: "post", Table: "TechnologyCheck" },
        function (data, status) {
            //alert(data.root.length);
            $.each(data.root, function (idx, item) {
                var str = "" + item.m_carTimes; +"";
          
                $("#mytable tr:last").after("" + str + "");
                //$('#displayTable tr:last').after('xiaoqinagxiaoqiang');
                styleFunc();

            });
        }, "json");