JavaScript Editor jscript editor     Web designer 



Main Page

This walkthrough describes how to integrate ASP.NET tracing techniques with System.Diagnostics tracing techniques and write all trace messages to a single tracing output.

You can use tracing to track the flow of execution for your application, to display data at critical points during a Web form's life cycle, and to discover how the Web forms interact with various other components of your application. Using tracing, you can examine HTTP request parameters that are submitted to your application, how much memory is being stored in view state for a particular Web form, and other useful profiling information.

The ASP.NET tracing mechanism writes messages that are displayed on ASP.NET Web pages and on the ASP.NET Trace viewer (Trace.axd), whereas the Trace class is used to write trace messages to the standard .NET Framework trace output (typically a console window). To make it easier to track how the Web forms interact with business objects and other components, you can integrate ASP.NET tracing output with System.Diagnostics tracing to route all tracing messages to one of these outputs.

Common scenarios that use both ASP.NET tracing and the Trace class include Web pages that use middle-tier business objects to interact with data and business rules and pages that use enterprise services, such as transactions and queues. In these situations, the business and enterprise components play key parts in the successful execution of the page and monitoring the execution flow of the pages across the multiple tiers of your application using a single tracing output is desirable.

In this walkthrough you will work with tracing. You will modify a Web page and a business object to write trace messages, and then route all messages to one tracing output.

Tasks illustrated in this walkthrough include the following:

Expand imagePrerequisites

Expand imageCreating a Web Page and Business Object

Expand imageAdding Trace Messages to a Web page and Business Object

Expand imageWriting Trace Messages

Expand imageRouting All Tracing Output to the Web Form

Expand imageRouting All Tracing Output to .NET Framework Tracing

Expand imageNext Steps

Expand imageSee Also



JavaScript Editor jscript editor     Web designer