2
私はモデルなどを表示するビューを持っている:ビューは、モデルのすべてのノートを表示するMVC 3 Ajax.ActionLinkパス親モデルプロパティ
public class MyModel()
{
public string name {get;set;}
public IList<Note> notes {get;set;}
}
、私は削除するAjax.ActionLinkを使用しようとしていますノートを削除するには、コントローラのアクション結果にモデルのIDを渡す必要があります。
public ActionResult DeleteNote(int modelId, int noteId)
{
var franchise = _franchiseRepository.FindById(modelId);
Note note = new Note(noteId);
franchise.RemoveNote(note);
_franchiseRepository.SaveOrUpdate(franchise);
return View();
}
Ajax.ActionLink("Delete", "DeleteNote", new {id=item.id}, new AjaxOptions{HttpMethod="POST"})
これはajax.actionlinkで実行できますか?事前
でおかげ