How to handle errors in server code

G

Guest

Hi,

In my ASP.NET 2 page, there's Javascript code that uses XMLHttpRequest class
to execute code (which access the database) on the server, and sends data
back to populate controls on the page.

How should errors be handled in the server code, for example when a database
error occurrs?

Thanks in advance,

Rick
 
M

Mike

Use a try{} catch{} in your methods. The catch{} will get trap your errors
and you can write them out to a log file, to the page, a db table, etc, if
you want as well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,270
Latest member
TopCryptoTwitterChannels_

Latest Threads

Top