1. Home
  2. Computing & Technology
  3. Visual Basic

Learn ASP.NET 2.0 - ASP.NET 2.0 Code-Behind and Database Updating

More program tracing

By Dan Mabbutt, About.com

Apr 20 2008

In addition to the trace information in Part 4 and above, ASP.NET more tracing capability that you can "turn on" in the Web.config file. The trace element can be added as a child element to <system.web>

<system.web>
   <trace
      enabled="true|false"
      localOnly="true|false"
      pageOutput="true|false"
      requestLimit="integer"
      mostRecent="true|false"
      writeToDiagnosticsTrace="true|false"
      traceMode="SortByTime|SortByCategory"
/>
</system.web>

When trace is enabled, ASP.NET will build a special web page that you can access in the root of your website. Just replace the name of the page with "trace.axd". The following illustration shows you how ...

--------
Click Here to display the illustration
Click the Back button on your browser to return
--------

You can also save the trace information in a file and use "trace listeners" to help debug your application. Tracing is a whole topic by itself and it takes practice and study to learn how to use the rich set of options available in ASP.NET 2.0.

Make sure you turn trace off again before put a page in production. Leaving it on not only slows down the performance of the page, it's a huge security hole if someone else accesses the trace information.

Explore Visual Basic

More from About.com

  1. Home
  2. Computing & Technology
  3. Visual Basic
  4. Learn VB.NET
  5. Learn ASP.NET
  6. Learn ASP.NET 2.0 - ASP.NET 2.0 Code-Behind and Database Updating

©2008 About.com, a part of The New York Times Company.

All rights reserved.