AJAX如何以POST的方式提交JSON数据到Form

解决方案:

var jsonData = { "id": "123"};
$.ajax({
            type: "post",
            url: '/Table/GridData',
            data:jsonData,
            async: false,
            dataType: "html",
            success: function (msg) {    // Do something interesting here.
                alert(msg.d);                
            }
        });

注意的几个地方:

1、dataType一定是“html”,不能是“json”

2、不能包含contentType: "application/json; charset=utf-8"

你可能感兴趣的:(ASP.Net)