O'Reilly logo

Professional ASP.NET 3.5 AJAX by Matt Gibbs, Dan Wahlin, Bill Evjen, Dave Reed

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

4.5. Errors and Debugging

Chapter 15 provides detailed information about testing and debugging ASP.NET AJAX applications, but this chapter on the AJAX Library would not be complete without a basic introduction to the debugging facilities. Debugging JavaScript can be quite challenging because of its dynamic interpreted nature. One of the reasons it is so difficult to debug is due to the fact that without being able to precompile JavaScript code, you often end up finding mistakes through runtime failures and errors. Further, runtime errors are not always helpful at assisting you identify the problem, although the extra debug mode messages are helpful.

It is important to note that Visual Studio 2008 now provides the ability to debug your JavaScript code directly in Visual Studio 2008. This allows you to step through your JavaScript code in the same manner as you step through your C# or Visual Basic code. Again, Chapter 15 covers this feature in more detail.

This next section shows you how to create your own debug trace window.

Figure 4-8. Figure 4-8
Figure 4-9. Figure 4-9

4.5.1. The Debug Trace Console

The Debug class makes tracking down issues easier. One of the facilities it supports is providing trace information from your code. You should always provide release and debug versions ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required