.NET Mobile Web Developer's Guide

Everyone has had to implement some form of tracing during some point of writing any Web application. Even from the earliest days of ASP, we have used Response.Write to tell us what lines of code are being hit within our programs. However, Response.Write can be painful to use. For instance, you never know where the Response.Write is going to hit on the page, and having the statements intermingled throughout all the code can get very messy.
ASP.NET provides an excellent integrated tool called tracing. Tracing allows you to track step by step what is happening during execution of your applications. The tracing provided by ASP.NET even gives you choices on how you would like to see your tracing output. Output for tracing can be at a page or at application level.
Page-level tracing will attach a mess of information regarding a single Web page at the end of the page after executing. This is done by adding one simple line of code to the top of your ASP.NET page within the @Page directive. The line would look something like this:
<%@ Page Language=VB Trace="True" %@>
Just so you can see how much is generated for a simple page. Figure 3.42 shows some simple HTML that we placed on an ASP.NET page and has included the trace statement.
<%@ Page Language="vb" AutoEventWireup="false" codebehind="WebForm1.aspx.vb" Inherits="Tracing.WebForm1"%><b class="bold"><%@ Page Trace="true"%></b>!doctype>