我从视图
进行了ajax调用function ChangeStatusFunction(associateId, status, comments, caseId) {
$.ajax({
type: 'POST',
url: '@Url.Action("ChangeCaseStatus", "PendingCase")',
dataType: 'html',
contentType: 'application/json; charset=utf-8',
data: { associateId: associateId, status: status, comments: comments, caseId: caseId },
success: function (data) {
$('.somecode').html('');
}
});
};
这是控制器代码
[HttpPost]
public ActionResult ChangeCaseStatus(string associateId, string status, string comments, string caseId)
{
IPendingCaseManager pendingMgr = new PendingCaseManager();
pendingMgr.ChangeCaseStatus(associateId, status, comments, caseId);
return null;
}
包含ajax的函数正在被调用,我测试了使用控制台日志,所有值都正确传递
但它没有触及控制器中的断点,即它没有调用控制器方法
我在ajax调用之后在控制台中收到此错误
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
答案 0 :(得分:0)
您通过ajax发送的数据存在问题 请在浏览器控制台上验证或检查错误。
数据:{associateId:associateId,status:status,comments:comments,caseId:caseId},