Anyone who has done ASP. NET development knows that the TRACE command is a very useful method for tracking and debugging pages. There are two ways to use trace:
1. Configure the TRACE command in Web. config
<Trace enabled = "true" requestlimit = "40" pageoutput = "false" tracemode = "sortbytime" localonly = "false"/>
After this command is configured, enter http: // host address/trace. axd in the address bar of the IE browser to view the trace information of the recorded access page.
The number of pages tracked by requestlimit
Whether pageoutput displays trace information at the bottom of the page
Page sorting method of trace mode
Localonly indicates whether to trace requests accessed by the local machine only.
2. Set the TRACE command on the ASPX page
In the page command of the page, addTrace = "true",The trace information is displayed at the bottom of the page.
If both are set, the commands on the ASPX page overwrite the configurations in Web. config.
However, both methods have a disadvantage. You need to constantly modify the configuration information and switch between true and false. The following describes a simpler method.
3. Program placement method
set code to join global. in asax, you can easily trace the page by adding parameters to the access path.
sub application_beginrequest (byval sender as object, byval e as eventargs)
'is used to process the trail. After the trail is published, you can remove these statements.
if not httpcontext. current. request. querystring ("debug") is nothing then
httpcontext. current. trace. isenabled = true
end if
end sub
usage: Add DEBUG = any value after each URL to be traced.