module 5: using trace in microsoft asp.net pages
DESCRIPTION
Overview of Tracing With Tracing You Can: Output variables or structures Assert whether a condition is met Trace through the execution path of the application Can Be Enabled and Disabled, Either on a Page-By-Page Basis or for an Entire ApplicationTRANSCRIPT
Module 5: Using Trace in Microsoft ASP.NET
Pages
Overview
Overview of Tracing Trace Information Page-Level Trace Application-Level Trace
Overview of Tracing
With Tracing You Can: Output variables or structures
Assert whether a condition is met
Trace through the execution path of the application
Can Be Enabled and Disabled, Either on a Page-By-Page Basis or for an Entire Application
Trace Information
Page-Level Trace
How Does Page-Level Trace Work? Demonstration: Adding Page-Level Trace Statements Tracing into a Component
How Does Page-Level Trace Work?
Enabling Tracing for a Page
Sorting Output by Category
Inserting Trace Messages
Conditional Execution with Trace.IsEnabled
<%@ Page Language="VB" Trace="true"%>
<%@ Page Language="VB" Trace="true" TraceMode="SortByCategory"%>
Trace.Write("category", "message")
If Trace.IsEnabled strTrace = 'create trace string hereEnd IfTrace.Write(strTrace)
Demonstration: Adding Page-Level Trace Statements
Tracing into a Component
Import the System.Web Library
Enable Tracing in Class Constructor
Add Trace Statements to Method
Imports System.Web
HttpContext.Current.Trace.IsEnabled = True
HttpContext.Current.Trace.Write _ ("component", "this is my trace statement")
Application-Level Trace
How Does Application-Level Trace Work? Demonstration: Adding Application-Level Trace
Statements
How Does Application-Level Trace Work?
Application-Level Trace Collects Additional Statistics from a Request in the trace.axd File
Enabling Application-Level Trace in web.config
<trace enabled="true"traceMode="SortByCategory"
requestLimit="40" pageOutput="true"/>
Demonstration: Adding Application-Level Trace Statements
Lab 5: Adding Trace to an ASP.NET Page
Review
Overview of Tracing Trace Information Page-Level Trace Application-Level Trace