我想在删除后刷新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