I have written a class, which I instanciate from the code-behind of an
aspx page. I want to output some items to the debugger from within the
class, but Debug.WriteLine and Trace.WriteLine don't seem to do
anything. Where am I going wrong?
You can get to the Trace class in your class using HttpContext.Current.
HttpContext.Current.Trace.Write("Your message here");
HttpContext is basically everything from a Http request. Everything is
here. the Page class members like Request, Response, Cache, etc.. are
actually calling HttpContext members.
HttpContext.Current is a Singleton of the the current http request, so
you cannot not create a new HttpContext yourself. You must use the