Trace in Controls

  • Thread starter Thread starter Libsta
  • Start date Start date
L

Libsta

I have coded a Trace.Write in the codebehind of a Control.
This message does not appear when I navigate to trace.axd.

If I place the Trace.Write in the codebehind of the WebForm which hosts
the control, the message appears in trace.axd.

Is it possible to use the Trace.Write method within a Control?



E.g.
MyControl.ascx.cs ...

private void Page_Load(object sender, System.EventArgs e) {
Trace.Write("any category", "any message");
}
 
Do you have tracing enabled in the page while trying to view trace output in
the control?

Try something like this.

Trace.IsEnabled = true;
Trace.Write("any category", "any message");
Trace.IsEnabled = false;
 
Back
Top