刷新GridMVC

时间:2015-07-03 13:31:39

标签: asp.net-mvc-4 model-view-controller

我想在删除后刷新GridMVC。

StudentsGrid.cshtml:

@model IEnumerable<AWS.Models.GroupedStudents>

@using GridMvc.Html
@{
   Layout = null;
 }
 ....

  //The Grid
  @Html.Partial("TheGridContents")
  ....

在控制器中我检查记录是否被删除,如果它被删除我想只刷新网格,如果它不是我显示错误信息:

public ActionResult DeleteRecord(string StudentID)
{
   var success = false;
    //All my code to delete the Row

   if (success)
       return RedirectToAction("StudentsGrid", "Home"); //Refresh
   else
       return Content("Failed");  
}

这是以下内容的一部分:

Display a confirmation message on Delete a record from a Grid

0 个答案:

没有答案