Contents
Overview 1
Overview of Tracing 2
Trace Information 3
Page-Level Trace 4
Application-Level Trace 9
Lab 5: Adding Trace to an ASP.NET Page 14
Review 15
Module 5: Using Trace
in ASP.NET Pages
BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY
Information in this document is subject to change without notice. The names of companies,
products, people, characters, and/or data mentioned herein are fictitious and are in no way intended
to represent any real individual, company, product, or event, unless otherwise noted. Complying
with all applicable copyright laws is the responsibility of the user. No part of this document may
be reproduced or transmitted in any form or by any means, electronic or mechanical, for any
purpose, without the express written permission of Microsoft Corporation. If, however, your only
means of access is electronic, permission to print one copy is hereby granted.
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual
property rights covering subject matter in this document. Except as expressly provided in any
written license agreement from Microsoft, the furnishing of this document does not give you any
Enable and disable tracing for an ASP.NET page.
Add custom trace information.
Materials and Preparation
This section provides the materials and preparation tasks that you need to teach
this module.
Required Materials
To teach this module, you need the following materials:
!
Microsoft
®
PowerPoint
®
file 2063A_05.ppt
!
Module 5, “Using Trace in ASP.NET Pages” (2063A_05.doc)
!
Lab, “Adding trace to an ASP.NET Page” (2063A_L05.doc)
Preparation Tasks
To prepare for this module, you should:
!
Read all of the materials for this module.
!
Complete all the demonstrations.
!
Complete the lab.
Presentation:
60 Minutes
works.
Module 5: Using Trace in ASP.NET Pages 1
BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY
Overview
!
Overview of Tracing
!
Trace Information
!
Page-Level Trace
!
Application-Level TraceIn earlier versions of ASP, tracing of code was accomplished by inserting
Response.Write statements, wherever required. One main drawback of this
technique was the removal of the excess code added when the application is
deployed, and thus the inability to use the output from the Response.Write
statements in a production environment. ASP.NET overcomes such drawbacks
by introducing an automatic tracing mechanism. This tracing mechanism can be
enabled and disabled either on a page-by-page basis, or for an entire
application, and can be configured in the config.web file.
After completing this module, you will be able to:
!
Describe page-level and application-level tracing.
!
Enable and disable tracing for an ASP.NET page.
Basis, or for an Entire ApplicationThe tracing feature enables you to insert debugging print statements into your
code to output variables or structures, assert whether a condition is met, or just
generally trace through the execution path of the application.
All this information is outputted with a page or saved to a log.
Topic Objective
To describe tracing.
Lead-in
Tracing enables you to see
the execution path and
output variable values from
your application.
Module 5: Using Trace in ASP.NET Pages 3
BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY
Trace Information Tracing provides a lot of information to the developer of an ASP.NET
application. The trace output screen contains the following categories of
information.
Category Description
Request Details Information about the request: session ID, time of request, type
of request, and the status.
Trace Information Output from standard and custom trace statements.
Control Tree List of all items on the page
what occurs when the framework processes a page request.
In this section, you will learn how page-level tracing works.
Topic Objective
To describe how page-level
tracing works.
Lead-in
ASP.NET aids the
debugging and testing
process by providing two
types of trace capabilities,
page-level and application-
level.