(1 ). note
many people generally use respone when debugging input. write (), or trace and then calculate the object Value in the Command window.
In fact, Microsoft provides a good output debugging class trace for Asp.net. here we will talk about its usage
(2) specific usage
page-level debugging and application Program -level tracing debugging:
1. page-level tracing: The following page commands are included at the beginning of the page: <% @ page trace = "true" tracemode = "sortbycategory/sortbytime" %>
I. sample custom message:
trace. write ("here is the variable or custom string for the output result");
trace. warn ("here is the string to be displayed"); // with trace. write is the same, but the font is red
check whether a trail is used
II. determine whether trace output is Enabled:
If (trace. isenabled) {trace. warn ("tracking enabled")}
2. Application-level tracking:
In the <system. Web> section of the web. config file, <trace enabled = "true" pageoutput = "true"/>
In this way, you do not need to set one page.
The biggest advantage of tracing debugging is that after a programmer is used up, the page or application tracing can be set to false.
You do not need to delete or annotate it because the compiler compiles it to the trace output.
Statement, it will not be compiled, it will skip the trace statement to continue to compile the following statement.
From the programmer's point of view, trace is equivalent to commented out