17.7. Summary

No matter how carefully you program, your site is likely to contain some bugs or throw exceptions at run time. To minimize these exceptions and build a site that runs as smooth as possible, there are a number of things you can do.

First of all, you can use exception handling techniques, where you write code that is able to catch exceptions that you foresee and handle them appropriately. Sometimes, updating a simple label to inform the user something went wrong is enough. In other cases, for example when the database server is down, there isn't much you can do. For those cases, the code that sends error messages by e-mail may come in handy, as it allows you to detect and analyze problems even if you're not logged in to the server.

To help you write code with as few bugs as possible, Visual Web Developer offers you a great set of debugging tools. The ability to break into your code and analyze and change the execution environment is a great time-saver. On top of that, you have the smooth debugging experience that allows you to debug from client-side code all the way into the server. Together, they make VWD a great tool in your bug-slashing adventures.

But even if you have debugged your application thoroughly, there's still a chance your site may have issues in production, whether they are related to performance, logic errors, or other unexpected reasons. In those cases, you can use the ASP.NET tracing facilities that let you track information about running pages. Analyzing ...

Get Beginning ASP.NET 3.5: In C# and VB now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.