Detailed description of ASP. NET tracking mode

Source: Internet
Author: User

【Abstract】 the tracking function of ASP. NET is much better than that of ASP. It is helpful to identify the root cause of errors in WEB applications through tracking information. This article explains in detail the tracking mode of ASP. NET through examples.
[Keyword] ASP. NET; Trace information; Trace
1. Introduction
The most common debugging method of ASP is to use Response. Write to set breakpoints and display the current values of some variables on the web page. However, this method has many problems.
(1) The program contains Response. Write statements, which may affect debugging and page layout.
(2) After the debugging is complete, delete these statements with pain points. When deleting redundant Response. Write statements, you must be careful to prevent the necessary Response. Write statements from being deleted by mistake. If there are hundreds of lines in the program, you can imagine the heavy workload.
ASP. NET introduces a new feature that allows you to write debugging statements directly in code, so that you do not need to remove the applications when deploying them to the production server. This function is called tracking. It allows you to write variables or structures on the page, determine whether the assertions meet certain conditions, or simply trace through the execution path of the page or application. To collect and display these messages and other tracing information, you must enable page or application tracing. When tracing is enabled, two things will happen:
(1) ASP. NET adds a series of diagnostic information tables to the output page. This information is also sent to the tracing Viewer application (only when tracing for the application is enabled ).
(2) ASP. NET displays custom diagnostic messages in the Trace Information table of append performance data. The specified diagnostic information and tracing message are appended to the page output sent to the requesting browser. Alternatively, you can view this information in a separate trace. axd, which displays the trace information for each page of a given application. When ASP. NET processes page requests, this information helps identify errors or unwanted results.
The trace statement is processed and displayed only after the trail is enabled. You can control whether to display a trail to a page, to a trace viewer, or to both a page and a trace viewer.
2. ASP. NET tracking mode configuration
To be able to use the tracing function, you must enable it within the page or the entire application.
2.1 page-level Configuration

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.