By Andrew Flick and Anthony Lombardo
In last month s article, Pop Ups, I promised to bring out Tony Lombardo as the author for this month s article. However, vacation and a heavy work load presented me with the opportunity to cover for Tony one more month and have the joy of bringing you another article. It s a shorter article because of the holidays, but still a good practice to know.
Preparing to Use the Debugger
Using the Debugger Method
To step through your code, simply use the debugger method in places that you may need to debug. If you need to debug your code at page load, simply add a function named load and have it called at the onload event for the body of the application:
Using the QuickWatch Window
var oContext = window.createPopup();
oContext.document.body.innerHTML = ContextMenu.innerHTML;
oContext.show(event.offsetX + 5, event.offsetY, 200, 75,
This code is missing the definition of the pop up and the location of where this method is called; however, it does provide us with a viable place to start debugging. If I highlight the text ContextMenu and then press Ctrl-Alt-Q or right-click and select QuickWatch, I am presented with the QuickWatch dialog.
This dialog allows me to drill into the ContextMenu object and find different values and figure out how everything is set. For instance, if I type the expression ContextMenu.InnerHTML, QuickWatch returns the expected value as found in the application.
Additional Power in VS.NET 2005
In Visual Studio 2005, you are given additional power by adding the capability to drill down into the object model without opening QuickWatch. Simply hover over the object you wish to explore while debugging and you re blessed with a browse able tooltip.
This additional power is even more helpful when searching for a specific reason as to why a certain value may or may not be set not to mention it has less steps than opening the QuickWatch window, which is more productive.
With these few tips, you now have the capability of diving down to the object model and effectively debugging your application. These powerful tools are usually only known about on the server side, but now you can do the same thing on the client side. With that, I hope everyone had a Happy Holidays and I wish you some happy debugging.
Andrew Flick is Product Manager - NetAdvantage Windows Forms Technologies & TestAdvantage for Infragistics, Inc. Prior to joining Infragistics, Andrew played an avid role in presenting on emerging .NET technologies throughout the Midwest to a variety of User Groups as well as numerous Student Groups. As an active member of the INETA Academic Committee, Andrew has authored content on building successful User Groups, as well as numerous white papers on building an effective community. A Microsoft MVP, Andrew joined Infragistics in July of 2004 as a Technology Evangelist, where he was responsible for the creation of reference applications and authoring .NET technology articles for industry leading publications, as well as the world wide delivery of Infragistics Technology demonstrations. Andrew currently serves as Infragistics Product Manager for NetAdvantage Windows Forms Technologies & TestAdvantage. As product manager, he spearheads the product management and strategies of Infragistics Windows Forms Product Lines from establishing the direction through delivery. Working directly with the Director of Development, he sets the direction, plans, and manages product development. Contact Andrew at mailto:[email protected].
Anthony Lombardo is Product Manager of NetAdvantage - ASP.NET Technologies for Infragistics, Inc., and is responsible for spearheading product management and strategies for Infragistics ASP.NET product line, working directly with the Director of Engineering to set the direction, plan, and manage product development. Prior to joining Infragistics, Anthony served as a Network Administrator for North Brunswick Board of Education and worked for Rutgers University in their technical support division. Since beginning his career with Infragistics in 2000, Anthony has been involved with every aspect of the development cycle, including playing a key role in the creation of the Presentation Layer Framework for ASP.NET, assisting in the creation and implementation of Infragistics Visual Studio 2005 project plan, and determining the product feature set for NetAdvantage 2005 for Visual Studio 2005. Contact Anthony at mailto:[email protected].