Click here to Skip to main content
13,247,704 members (42,421 online)
Click here to Skip to main content
Add your own
alternative version


2 bookmarked
Posted 11 Oct 2013

Tracing for an application

, 11 Oct 2013
Rate this:
Please Sign up or sign in to vote. offers a built-in functionality for tracing theapplication. Using this functionality one can view a lot ofdiagnostic

Editorial Note

This articles was originally at but has now been given a new home on CodeProject. Editing rights for this article has been set at Bronze or above, so please go in and edit and update this article to keep it fresh and relevant. offers a built-in functionality for tracing the application. Using this functionality one can view a lot of diagnostic information which is rendered as the page output when the tracing is enabled. This tracing information can also be viewed using Trace Viewer. Tracing is output in a tabular format on the page and in the trace viewer too.

As many other features, tracing can be enabled at the page level as well as at the application level.

To enable tracing at the Page level, include Trace=”true” attribute in the @Page directive, for the page you want tracing to be enabled.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TestTracing._Default"


Run your application, and you'll see the Tracing information on the page where tracing has been made enabled. This information is always showed at the bottom of the page after all the page controls are done with rendering. So, if you have nothing on the page, the page will be showing only the Tracing information.

To enable tracing at the Application level, add a trace element as a child to the system.web element and set its 'enabled' attribute to 'true'.


<trace enabled="true" pageOutput="true" requestLimit="10"/>


The other attributes include;

pageOutput; which lets you choose whether to output the tracing information in the page too or only in the trace viewer. requestLimit; number of trace requests to store on the server. Default value is 10 for this attribute.

To use Trace Viewer for viewing Tracing information, just navigate to “Trace.axd” in your application. Its in the root and you can navigate to it by entering URL like this “http://localhost/MyApplication/Trace.axd”

Tracing information includes; Request Details, Trace Information, Control Tree, Session Collection, Cookies Collection, Forms Collection, Headers Collection, Server Variables.



This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

ASP.NET Community
United States United States
This member doesn't quite have enough reputation to be able to display their biography and homepage.
Group type: Collaborative Group

764 members

You may also be interested in...


Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.171114.1 | Last Updated 11 Oct 2013
Article Copyright 2013 by ASP.NET Community
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid