Ajax 経由で DELETE (推奨) または POST を実行しようとしています。
$(document).ready(function () {
$("a.deleteOne").click(function () {
var id = $(this).parents('td:first').children('.hiddenId').val();
var title = $(this).parents('tr:first').children('td:first').text();
if (confirm("Really delete the [" + title + "] document?")) {
$.ajax({
type: "POST",
url: "/WebApp/Area/Documents/Delete/" + id,
//data: { id: id },
success: function () { alert("Document [" + title + "] deleted."); },
failure: function () { alert("Document [" + title + "] was NOT deleted."); }
});
}
});
return false;
});
何らかの理由で、コントローラーのアクションが呼び出されていません。
Action code looks like:
[ValidateAntiForgeryToken]
[Transaction]
[AcceptVerbs(HttpVerbs.Post)]
//[AcceptVerbs(HttpVerbs.Delete)]
public ActionResult Delete(int id)
{
if (!BaseAuthorizationProvider.HasPermissionToPerform(App.Core.Security.Operations.CreateDocumentTask))
{
HandlePermissionException();
}
ActionConfirmation deleteConfirmation = DocumentManagementService.Delete(id);
TempData[ControllerEnums.GlobalViewDataProperty.PageMessage.ToString()] = deleteConfirmation.Message;
return RedirectToAction("Index");
}
私は何が欠けていますか?