O'Reilly logo

Learning ASP.NET 2.0 with AJAX by Dan Hurwitz, Jesse Liberty, Brian MacDonald

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

Chapter 8: Errors, Exceptions, and Bugs, Oh My!

Answers to Quiz Questions

  1. Add Trace="true" to the @Page directive of the page you want to trace.

  2. The only difference is that Trace.Warn writes to the trace log in red.

  3. Trace.Write and Trace.Warn can both take a category string, a message string, and an exception object.

  4. Click in the left column of any code file to set a breakpoint. A red dot will appear on the line where you set the breakpoint.

  5. Simply hover the mouse over the variable, and a pop-up will appear, showing its value.

  6. When the application is stopped at a breakpoint, you can use the Immediate window to change the value of a variable.

  7. The Locals window shows the variables in the current context, and their values.

  8. Syntax errors are errors in the code that violate the rules of the language. The IDE can catch most of these for you. Logic errors occur when the syntax of code is correct, but the code does not provide the results that the programmer expected.

  9. In the web.config file, you need to create a <customErrors> section, and set the mode attribute to On.

  10. Add the ErrorPage attribute to the @Page directive, where you can specify the error page that will apply only to errors generated by the current page.

Answers to Exercises

Exercise 8-1. After you've downloaded the file, open Default.aspx, and add the attribute Trace="true" to the @Page directive. You've now enabled tracing on this file. Open Default.aspx.vb, where you'll find the event handler for the drop-down list. Insert a line of ...

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