【发布时间】:2010-06-16 22:22:39
【问题描述】:
<%= 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) 我将如何显示确认在显示新记录后,记录在同一列表页面上被删除?
【问题讨论】: