【问题标题】:ajax.action link delete not able to display the updated recordsajax.action 链接删除无法显示更新的记录
【发布时间】: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) 我将如何显示确认在显示新记录后,记录在同一列表页面上被删除?

【问题讨论】:

    标签: asp.net-mvc asp.net-mvc-2


    【解决方案1】:

    我使用部分视图解决了我的问题

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-04-09
      • 1970-01-01
      • 1970-01-01
      • 2019-08-26
      • 2012-07-05
      • 2011-08-07
      • 1970-01-01
      相关资源
      最近更新 更多