0
<%= Ajax.ActionLink("Delete", "Delete", new { id = item.int_GroupId }, new AjaxOptions {HttpMethod="Delete", Confirm="Delete Group with Group ID:" + item.int_GroupId + " Group Name:" + item.vcr_GroupName})%>|
[HttpDelete]
public ActionResult Delete(int id, FormCollection collection)
{
try
{
Group group = _db.Groups.First(c => c.int_GroupId == id);
_db.Groups.DeleteOnSubmit(group);
_db.SubmitChanges();
return RedirectToAction("ManageGroup"); // redirect to same list page
}
catch
{
return RedirectToAction("ManageGroup"); // redirect to same list page
}
}
1)我将如何显示删除操作后更新的记录。对我来说,重定向操作不会发生,原因不明。什么是您在这里使用的最佳方式 2)如何显示确认在显示新记录后,记录在同一个列表页面上被删除?ajax.action链接删除无法显示更新的记录