<script type="text/javascript">
function complete(args) {
if (args.requestType == "beginedit" || args.requestType == "delete" || args.requestType == "add" ||
args.requestType == "save" || args.requestType == "cancel") // Condition for CRUD operations in action
complete event to show the custom message.
alert("ActionComplete is triggered ");
}
function failure(args) {
if (args.requestType == "beginedit" || args.requestType == "delete" || args.requestType = "add" ||
args.requestType == "save" || args.requestType == "cancel") // Condition for CRUD operations in action
failure event to show the custom message.
alert("ActionFailure is triggered ");
}
</script>
|
public ActionResult DataSource(DataManager dm, bool? ckFlagTratt)
{
try
{
. . . ..
. ..
return Json(result, JsonRequestBehavior.AllowGet);
}
catch (Exception ex)
{
. .. .
. .. .
Session["Error"] = "Errore in loading";
return RedirectToAction("GridFeatures", "Grid");
}
}
function FailureMessage(args) {//actionFailure event of Grid
var Error = '@Session["Error"].ToString()';
$("#divErrorView").text(Error).show();
. . .
. . .
} |