To quickly add variable info to a webpage trace report add debug and trace switches to the page directive like this:
<%@ Page Language="C#" Inherits="cal" src="cal.cs" debug="true" trace="true" %>
Then to insert a comment or variable value into the trace output use this:
Trace.Write("SQL",sSQL)
or
Trace.Write("Note:","This is where we crash")