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

Jquery Ajax Post 数据的时候提示序列化的问题
ajax 方法段

 $.ajax({
                url: "RoleFunc.aspx/VConvert",
                    type: "POST",
                    contentType: "application/json;",
                    data: '{"strJson":' + json + '}',
                    dataType: 'json',

                    success: function(result) {
                        alert(result);

                    },
                    error: function() {
                        alert("error");
                    }
                });

json 通过js处理得到的是
[{"Role_ID":"2","Customer_ID":"155","Brands":"Chloe;","Country_ID":"96;"}]

Post出去的参数为
{"strJson":[{"Role_ID":"2","Customer_ID":"155","Brands":"Chloe;","Country_ID":"96;"}]
}

Debug了一下 没有进入后台的VConvert方法.直接就提示error
Type 'System.String' is not supported for deserialization of an array.
请问这是为什么

------解决方案--------------------
要看你VConvert当时是怎么定义的了