阅读背景:

如何在使用ASP时在客户端显示错误。净MVC AJAX

来源:互联网 

I am using ASP.NET MVC AJAX with the @AJAX.ActionLink helper to implement item deletion from a grid. When the request is executed it returns the grid without the deleted item and the AJAX helpers replace the grid. This works just fine but the problem is what to do if the item cannot be deleted (in my case due to foreign key constraints). How can I report the error to the client and display appropriate message. I don't want to use the OnFailure function blindly because I don't want to show the same error message for all errors. Ideally there will be a way to send specific error from the action and inspect the error in the JavaScript OnFailure function but I can't seem to find it. I am using ASP.NET MVC AJAX with the @AJAX.Acti




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: