How to Test and Debug an ASP.NET Application—How to work in break mode

Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio


Jump to: navigation, search
CSharp-Online.NET:Tutorials
ASP.NET Tutorials

How Test and Debug ASP.NET

© 2006 Mike Murach & Assoc.

How to work in break mode

Figure 4-11 shows the Order page in break mode. In this mode, the next statement to be executed is highlighted. Then, you can use the debugging information that’s available to try to determine the cause of an exception or a logical error.

For example, you can place the mouse pointer over a variable, property, or expression to display its current value in a data tip. You can also display the values of the members of an array, structure, or object. To do that, place the mouse pointer over the array, structure, or object to display its data tip, and then point to the plus sign in that data tip. In this figure, for example, you can see the current values of the members of the Product object named selectedProduct.

You can also use a data tip to change the value of a variable or property. To do that, just right-click the data tip and then choose Edit Value from the shortcut menu. When you do, the value that’s displayed will become editable so you can enter a new value.

You can also see the values of other properties and variables in the Autos window near the bottom left of the Visual Studio window. You’ll learn more about the Autos window and some of the other debugging windows in a minute.

Figure 4-11 How to work in break mode

The Shopping Cart application in break mode

Description

• When you enter break mode, the debugger highlights the next statement to be executed.

• You can use the debugging windows and the buttons in the Debug menu and toolbar to control the execution of the program and determine the cause of an exception.

• To display the value of a variable or property in a data tip, position the mouse pointer over the variable or property in the Code Editor window. To display a data tip for an expression, highlight the expression and then point to it. The expression must not contain a method call.

• To display the members of an array, structure, or object in a data tip, position the mouse pointer over it to display its data tip, and then point to the plus sign in the data tip.

• To change the value of a variable in a data tip, right-click the data tip, choose Edit Value, and then enter the new value.

• To continue program execution, press F5 or click the Continue button in the Standard or Debug toolbar. For more options about controlling program execution, see figure 4-12.


Previous_Page_.gif Next_Page_.gif

Personal tools