.NET Samples - ASP.NET Tracing

This section includes the following samples:

Trace1 Sample

Trace2 Sample

Trace1 Sample

This sample shows the default output when page-level tracing is enabled for an ASP.NET page. ASP.NET inserts timing information for important places in the page's execution lifecycle.

Namespaces used in this sample:

System.Data; System; System.Data.SqlClient

Classes used in this sample:

SqlConnection; DataAdapter; SqlDataAdapter; DataSet; Image; Binder; DataBinder; Page; Container; Import; Table; DataList; Path; Object; Trace; EventArgs; Button; DropDownList; Header; String; ImageButton; Url

Trace2 Sample

This sample shows the use of Trace.Write and Trace.Warn to output debugging statements in an ASP.NET page. Also note the use of the Trace.IsEnabled property to conditionally run extra debugging code. In this sample, the trace information has been sorted by category.

Namespaces used in this sample:

System.Data; System; System.Data.SqlClient

Classes used in this sample:

Trace; DataSet; Table; SqlConnection; DataAdapter; Image; SqlDataAdapter; Container; DataBinder; Page; Binder; Path; DataList; Object; String; EventArgs; Import; Button; Url; Header; DropDownList; ImageButton