0
リストビューからAjaxを使って削除しようとしていますが、 "Delete(Ajax)"ボタンを押すとコントローラメソッドには入力されず、エラーが発生します:mvc3でajaxを含む行を削除する
The resource cannot be found. Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly. Requested URL: /Idea/DeleteAjax/30
//controller
[HttpPost]
public ActionResult DeleteAjax(int id)
{
IdeeRepository ideeRepo = new IdeeRepository();
WIKIIDEE idee = new WIKIIDEE();
idee = ideeRepo.GetIdeeByID(id);
ViewModels.AjaxResponseVM ajaxVM;
try
{
ideeRepo.DeleteIdea(idee);
ideeRepo.SaveIdea();
ajaxVM = new ViewModels.AjaxResponseVM(Convert.ToInt32(idee.ID), "Idee eliminato con successo!");
}
catch
{
ajaxVM = new ViewModels.AjaxResponseVM(-1, "Error!");
}
return Json(ajaxVM);
}
//ビュー
@Ajax.ActionLink("Elimina Idea(Ajax)", "DeleteAjax", "Idea", new { id = ViewBag.Ideas[i].ID }, new AjaxOptions { Confirm = "Are you sure!", OnSuccess = "DeleteResponse", HttpMethod = "POST" })