ASP. NET page trace skills

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.