Tuesday, December 2, 2008

ASP.NET: View Trace Information on your ASP.NET Web Pages

If you want to see a huge amount of info about your pages, add Trace="true" to the @Page directive at the top of each ASP.NET page. An example is:

<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="editusers.aspx.vb" Inherits="xoc.ZapEm.EditUsers" Trace="true" %>
Alternately, you can instead change the web.config file for the web site. Change the trace enabled="false" to enabled="true". Then visit the virtual page trace.axd; if your web site is example.com, then visit http://www.example.com/trace.axd. This will show the trace information for the last 10 web pages on your site with all the debugging information.

Obviously, you should only use this for debugging and turn it to false before posting to a production web server. Info that you will get: