2X faster development
The ultimate ASP.NET MVC UI toolkit to boost your development speed.
In some cases, we may like to return a custom message from the controller after completing CRUD operations such that when an operation fails at server side. Solution We can return the custom message from controller by throwing exception and handling it at client side using the ActionFailure event of the Grid. Grid Rendering Code.
Code Behind
2. Handle the returned message in the ActionFailure event of the Grid.
Solution #2: We can also, add the exception message to the response header and fetch the message in the arguments of the ActionFailure event of the Grid at client side.
Handle the exception message from the response header using the getResponseHeader method of the args.error argument of the ActionFailure event.
|
2X faster development
The ultimate ASP.NET MVC UI toolkit to boost your development speed.
This page will automatically be redirected to the sign-in page in 10 seconds.
The code below fires correctly on the grid ActionFailure but the alert message show "Undefined". Please help. I'm using EJ2 version 16.4500.0.48.
2. Handle the returned message in the ActionFailure event of the Grid.
function
failure(args) {
alert(args.error.statusText);
//get the exception message
}
_code xxxxx1. 1. list text herehere_