JavaScript Debugging
I've recently been asked to review a few of the ASP.NET 3rd party controls that provide the very rich client-side user experience. One such control is Infragistic's UltraWebGrid2. While this control is really quite nice, there is the need to include some of your own JavaScript to utilize the control to its fullest extent. In this process I was reminded why I stopped working on web front-ends a few years before ASP.NET: the frustration of trying to debug JavaScript.
But now -- WOW -- Visual Studio.NET comes thru with flying colors. Just two simple steps to client-side debugging nirvana.
- Clear the "disable script debugging" checkbox in Internet Explorer's advanced properties.
- Add the keyword "debugger" somewhere within your JavaScript.
When you run the web page from Visual Studio in debugging mode, viola--when it hits the "debugger" statement, the Visual Studio debugger window takes control, you can set your break points, and proceed as normal. You can even get very clever setting the "debugger" from within script created from you server-side code that's registered with one of the many "Register" client-side script block methods.