后台C#
var s = '{"rows":[';
var rows = $("#tt").datagrid("getRows");
console.log("长度:"+rows.length);
for (var i = 0; i < rows.length; i++) {
s += '{"ID":"' + rows[i].id + '","name":"' + rows[i].name + '","number":"' + rows[i].number + '","date_single":"' + rows[i].date_single + '"},';
}
s += ']}';
$.ajax({
type: 'POST',
url: "test_calendar.aspx/submit",
dataType: 'json',
data:{jsonstring:s},
contentType: "application/json; charset=utf-8",
success: function (msg) {
//msg是返回的结果,这里对返回值进行处理
}
});
后台怎么写?怎么接收?