20.7. Editing a Value during Execution

A good debugger (a person, not a tool) is part detective. When code misbehaves, it sometimes helps to reenact the crime at the scene by using different values. Perform what if scenarios by breaking into the debugger, changing values, allowing execution to continue, and observing the result.

Note: Visual Web Developer Express does not support this feature.

Follow these steps to edit a value during the execution of an ASP.NET page:

  1. In Visual Web Developer, open a debugged version of Listing 20-1.

  2. In the btnOK_Click event handler, place a breakpoint at the End Sub line.

  3. Run the page in the debugger (F5) and click OK.

    The program breaks into the debugger at the End Sub.

  4. Open the Autos window (DebugWindowsAutos).

  5. Double-click the lblText.Text line, shown in Figure 20-11, and change the value inside the quotation marks to the following:

    &#169 2008
    Figure 20-11. Changing a program value on the fly.
  6. Continue running the code (F5).

    The label displays the changed markup rather than the text of the item chosen in the drop-down list. See Figure 20-12.

You find that the ability to experiment with values in the debugger saves time compared to stopping the entire ...

Get ASP.NET 3.5 For Dummies® 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.