如何使用模式弹出窗口或JQuery处理错误 [英] How to handle error using modal popup or JQuery

查看:117
本文介绍了如何使用模式弹出窗口或JQuery处理错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的项目中处理错误处理.

我想向最终用户显示错误.

需要处理以下示例错误,并显示给最终用户.

1.如果服务器连接失败.
2.如果SQL插入/更新/删除失败
3.Javascript错误等

如何处理上述错误,以及如何在Modal弹出窗口或JQuery中显示错误消息.
请为我提供确切的解决方案...

I want to handle Error Handling in my projects.

i want to display the errors to end user.

The below example error needs to be handle and display to end users.

1.If server connection fails.
2.If SQL insertion/updation/deletion fails
3.Javascript error,etc.

How to handle the above error and also how to display the error message in Modal popup or JQuery..

pls. provide me the exact solutions...

推荐答案

亲爱的朋友,

借助ajax,错误处理要查找的错误类型非常简单.

将Ajax句柄类包括到您的代码文件中(可能是C#或VB.Net),然后尝试将您要在Java-中显示错误的所有方法放在Ajax类下(使用TRY {} CATCH(){}处理函数).脚本或jquery.

然后从jquery或java-script调用相同的函数,并从该方法返回适当的消息.在这里,您可以通过以下方式轻松显示来自该方法的消息:错误消息或成功消息:-

Dear Friend,

With the help of ajax it is very simple to error handle the kind of errors you are looking to handle.

Include the Ajax handle class into your code file may it be C# or VB.Net and then try to put all the methods under the Ajax class (with TRY{} CATCH(){} handler) for which you want display errors in java-script or jquery.

Then call the same functions from jquery or java-script and return the appropriate message from the method. From here you can easily display the message coming from the method may it be an error message or a success message through:-

Alert(''"+[your message]+"'');



在这里,您不会从任何人那里获得完整的解决方案,而是我们可以为您提供解决方案的指南;您必须自己尝试一下,然后如果您陷于某个地方,那么我们绝对可以为您提供帮助.

希望您能理解并尝试我为您提供的方式.

我还为您提供了一些参考资料,可以帮助您:-

http://www.asp.net/ajaxlibrary/AjaxControlToolkitSampleSite/

http://www.asp.net/ajaxlibrary/act.ashx

http://jquery.com/

谢谢

Varun Sareen



Here you will not get the full solution from anyone rather we can guide you the way to the solution; you have to give the try yourself and then if you get stuck up somewhere then we can definitely help you out.

I hope you understand and try the way i provided you.

I am providing you also with some references that may help you out:-

http://www.asp.net/ajaxlibrary/AjaxControlToolkitSampleSite/

http://www.asp.net/ajaxlibrary/act.ashx

http://jquery.com/

Thanks

Varun Sareen


这篇关于如何使用模式弹出窗口或JQuery处理错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆