
258
|
Chapter 12: The Page Class
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Parameter
TraceContext
An instance of the
TraceContext class.
Example
The example turns tracing on programmatically by using the Trace property of the
Page class:
Sub Page_Load( )
If Trace.IsEnabled = True Then
Message.Text = "Tracing is enabled."
Else
Message.Text = "Tracing is not enabled."
End If
End Sub
Notes
As with the Request and Response properties, while you can retrieve a local refer-
ence to the TraceContext instance associated with the request, it is more common
to access this instance directly through the Trace property, as shown in the
preceding example. For more information on application tracing, see Chapter 10.
User
IPrincipal = Page.User
Returns an instance of an object implementing the IPrincipal interface containing
security information about the user making the page request. The
IPrincipal
interface implements the members shown in Table 12-5.
Parameter
IPrincipal
An object variable that implements
IPrincipal.
Table 12-4. TraceContext class members
Member Description
IsEnabled Indicates whether tracing is enabled for the current page.
TraceMode A member of the TraceMode enumeration that indicates how items should be sorted. Possible values
are
SortByCategory and SortByTime. The latter is the default value defined in machine.config.
Warn method Writes ...