Re: Programmatically enable trace debug for a page




I wish it were that easy. The compiler gives me these errors:

Error 1 Property or indexer 'System.Web.UI.Page.Trace' cannot be assigned to --
it is read only H:\Code\VC#\TestApp\1.0\Default.aspx.cs 83 17 H:\...\2.0\

Error 2 Cannot implicitly convert type 'bool' to 'System.Web.TraceContext'
H:\Code\VC#\TestApp\1.0\Default.aspx.cs 83 30 H:\...\2.0\



"Dominick Baier" <dbaier@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:4580be631548a8c8b210d9d3cf9c@xxxxxxxxxxxxxxxxxxxxx
Page.Trace = true;

---
Dominick Baier, DevelopMentor
http://www.leastprivilege.com

Is there a way to enable the trace output programmatically? For
example in the
web.config under I have:
<trace enabled="true" localOnly="true" pageOutput="true" />
but then I would like the code to decide at runtime (by a variable in
the URL query string or something) if debug tracing output should be
displayed for that page (similar to localOnly="false"). Any
suggestions?





.



Relevant Pages

  • Re: Programmatically enable trace debug for a page
    ... Dominick Baier, DevelopMentor ... Error 1 Property or indexer 'System.Web.UI.Page.Trace' cannot be ... the URL query string or something) if debug tracing output should be ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Programmatically enable trace debug for a page
    ... Dominick Baier, DevelopMentor ... the URL query string or something) if debug tracing output should be ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Securing static files
    ... Dominick Baier - DevelopMentor ... they are kicked back to the login page. ... The user may log in with other credentials. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: How to determine if the logged on user is in a group
    ... Dominick Baier - DevelopMentor ... I found that you to reboot the SERVER after you create a new group and put users in it so that the new group and the users appear in the whoami list on the server. ... although he is a member of these groups. ...
    (microsoft.public.dotnet.security)
  • Re: HOWTO: Prevent Dynamic Loading of internal Types
    ... Dominick Baier - DevelopMentor ... Henning Krause ... I could get the public key from the entry assembly via ...
    (microsoft.public.dotnet.security)