views:

165

answers:

2

I'm looking for a way to enable trace for an ASP.Net page via codebehind without using the page or webconfig methods.

My end goal is to have a page that reacts to a querystring element such as ?trace=true then show the tracing information, but prior to that the page would display normally.

I've done some googling and my combination of words ends up with tutorials on using trace in general so any help would be much appreciated.

Thanks -Birk

+1  A: 

You could add an iframe to your page that refers to trace.axd and only render this iframe if the query string contains "trace=true"

Corne
This is a good solution too... I might give this a try sometime.
Birk
+1  A: 

You can set Trace.IsEnabled to true in the codebehind.

Greg
Perfect, just what I was looking for.
Birk