This is a migrated thread and some comments may be shown as answers.

[Solved] How to handle ajax errors returned from server?

1 Answer 120 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Raymond
Top achievements
Rank 1
Raymond asked on 20 Jul 2011, 06:08 PM
One of the things that bugs me about ajax editing is that I don't know how to handle errors (like business rule validation errors). For example, if I were to order 100 units of product ABC but upon a database check discover there were only 90 units, I would want to communicate back to the UI that there wasn't enough units to order.

Ideally, the error message would be handled in exactly the same way as modelstate validation errors (e.g . The field xyz is required) Currently, Telerik Grid does this with it little box "cloud" box with red letters. However, I'm okay if the error message shows up somewhere else.

Do you have any example code of how to do this? All the sample code shows handling of client errors.

Thanks,

1 Answer, 1 is accepted

Sort by
0
venky
Top achievements
Rank 1
answered on 04 Oct 2011, 12:16 PM
I am interested in knowing on how to handle database checks/errors in AJAX binding mode too.
I am using ASP MVC3 with telerik 2011.1.315 release. I have tried trapping the onerror client event for the grid
but the XMLHttpRequest.responseText is always empty for database errors.
@Telerik Team: Any help?
Thanks, Venky
Tags
Grid
Asked by
Raymond
Top achievements
Rank 1
Answers by
venky
Top achievements
Rank 1
Share this question
or