Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
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...
Posted

1 solution

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]+"');


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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900