You have a couple of options
Here's a link to the MSDN article How to: Enable Tracing for an ASP.NET Application
You can view trace info by going to http://localhost:<portnumber>/trace.axd
If you're using Visual Studio you can use:
System.Diagnostics.Debug.WriteLine("This appears in the output window!")