我有一个ajax调用,我通过它调用我的Web Api.My代码如下 -
function DataFrame() {
var abc = {};
abc.Country = countryName;
abc.Month = monthName;
abc.SampleData = selectedStores;
var datatoSend = JSON.stringify(abc);
jQuery.support.cors = true;
$.ajax({
url: URL + '/api/Sample/AddSampleToFrame/',
type: "Post",
data: JSON.stringify(datatoSend),
contentType: 'application/json; charset=utf-8',
success: function (result) {
if (result.length > 0) {
_sampletabledata = $.parseJSON(result);
PoplulateListSample();
PopulateSampleCheckBox();
BindSampleGrid();
BindBoxesWithSet();
}
}, //success of ajax
return false;
}
此代码返回错误500 。需要您的建议