We can enable ASP.NET tracing on a page-by-page basis by
adding "Trace=true" to the Page directive in any ASP.NET page.
Listing 1
<%@ Page Language="C#" Trace="true" TraceMode = "SortByCategory"
Inherits = "System.Web.UI.Page" CodeFile="Default.aspx.cs" %>
We can also add the TraceMode attribute that sets
SortByCategory or the default, SortByTime. SortByTime option is used to see the
methods that take up the most CPU time in application. We can enable tracing
programmatically using the Trace.IsEnabled property.