これは私のjQueryajax関数です
//delete individual row
jQuery('.stdtable img.delete').click(function(){
var c = confirm('Continue delete?');
if (c) {
jQuery.ajax({
url: 'market/delete/14',
type: 'POST',
success: function () {
alert('success');
},
error: function () {
alert("error");
}
});
};
return false;
});
そしてこれは私のコントローラーです
[HttpPost]
public ActionResult Delete(int id)
{
Using<MarketService>().Delete(int);
return View();
}
コードは私のコントローラーを呼び出しており、すべてが完璧に機能します。しかし、jQuery関数は常に「エラー」を返します。
なにが問題ですか?