Asp.net, vb.net, C#.net Resources

Welcome to Asp.net, vb.net, C#.net Resources Sign in | Join | Help
in Search

How can I use Tracing in Custom Components?

Last post 08-30-2006, 2:16 AM by Webdeveloper. 2 replies.
Sort Posts: Previous Next
  •  08-21-2006, 3:12 AM 239

    How can I use Tracing in Custom Components?

    How can I use Tracing in Custom Components?
  •  08-30-2006, 2:16 AM 1020 in reply to 239

    Re: How can I use Tracing in Custom Components?

    In Custom Components, you can use tracing if you reference the System.Web namespace and use the HttpContext.Current object to get a reference to the current context. Eg:
    VB.NET


    System.Web.HttpContext.Current.Trace("xxx", "Message")


    C#


    System.Web.HttpContext.Current.Trace("xxx", "Message");


    Also make sure to set the following directives:

    For Page Level Tracing set Page Directive as


    <%@ Page Trace="true" %>


    For Application Level Tracing modify corresponding web.config as


    <configuration>
         <system.web>
              <trace enabled="true" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true" />
         </system.web>
    </configuration>

  •  08-30-2006, 2:16 AM 1021 in reply to 239

    Re: How can I use Tracing in Custom Components?

    In Custom Components, you can use tracing if you reference the System.Web namespace and use the HttpContext.Current object to get a reference to the current context. Eg:
    VB.NET


    System.Web.HttpContext.Current.Trace("xxx", "Message")


    C#


    System.Web.HttpContext.Current.Trace("xxx", "Message");


    Also make sure to set the following directives:

    For Page Level Tracing set Page Directive as


    <%@ Page Trace="true" %>


    For Application Level Tracing modify corresponding web.config as


    <configuration>
         <system.web>
              <trace enabled="true" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true" />
         </system.web>
    </configuration>

View as RSS news feed in XML
Powered by Community Server, by Telligent Systems