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.
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.
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.
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:|