Can't get Trace to work when used in .cs class

J

Joe Rattz

I can get the Trace.Write() to work if I put the code in
an aspx.cs file. But, I have a (C#) class called by my
aspx.cs code that also has Trace messages, but none of
them show up in the Trace file, Trace.axd. Does anyone
know why?

Thanks.
 
J

John Saunders

Joe Rattz said:
I can get the Trace.Write() to work if I put the code in
an aspx.cs file. But, I have a (C#) class called by my
aspx.cs code that also has Trace messages, but none of
them show up in the Trace file, Trace.axd. Does anyone
know why?

Probably because your .cs file is using System.Diagnostics.Trace.Write?

Try passing the Page.Trace object to your methods in the C# class.
 
J

Joe Rattz

Probably because your .cs file is using
System.Diagnostics.Trace.Write?

Yes, it is. Well, where is it writing the trace at? It
doesn't throw an exception so it must be a legitimate
Trace object, correct? So, why should I need to pass it?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top