Name

Trace

Synopsis

TraceContext = Context.Trace

Returns the TraceContext for the current request. The members of the TraceContext class are listed in the entry for the Trace Property in Chapter 12.

Parameters

TraceContext

A TraceContext variable to receive the TraceContext object for the current request.

Example

The example retrieves the date and time of the request and displays it in the Message label control.

Sub Page_Load(  )
   Message.Text = "Trace Enabled? " _ 
      & Context.Trace.IsEnabled
End Sub

Notes

Trace can be enabled by setting the Trace attribute of the @ Page directive to True.

Get ASP.NET in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.