Я пытаюсь отправить с ajax объект javascript на asp. net контроллер, но я получаю код 500 внутренняя ошибка сервера Вот мой код
***JS CODE***
$.ajax({
type: 'POST',
url: '/PackageCtr/AjaxRequest',
data: JSON.stringify(package),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response)
{
if (response != null)
{
console.log(response);
}
},
failure: function (response)
{
console.log(response);
},
error: function (response)
{
console.log(response);
}
});
***Controller PackageCtr Code***
[HttpPost]
public string AjaxRequest(MyPackage package)
{
MyPackage package = package;
return "Success";
}
Буду признателен за помощь в устранении этой проблемы