I have some ajax on client side. It looks like
$.ajax({
cache: false,
type: "POST",
url: "@(Url.Action("AddShipmentRestriction", "ShipmentRestrictions"))",
data: postData,
success: function(data) {
var grid = $("#newsletter-subscriptions-grid").data('kendoGrid');
grid.dataSource.read();
},
error: function(xhr, ajaxOptions, thrownError) {
alert('Failed to add record.');
}
});
And on a method on controller i have
f (r != null)
{
return Json(new { Result = false }, JsonRequestBehavior.AllowGet);
}
else
{
var shipmentRestrictionRecord = new ShipmentRestrictionsRecord()
{
ShipmentMethodId = shippingMethod.Id,
StateProvinceId = stateproviceId
};
_shipmentRestrictionsService.Add(shipmentRestrictionRecord);
}
return Json(new { Result = true }, JsonRequestBehavior.AllowGet);
}
So true result reread my grid and its fine. But on false i want to see this notification from ajax but I don't!
Could u please tell me why?