
User | 299
HttpContext
Class
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Timestamp
timestamp = Context.Timestamp
Returns a DateTime object containing the date and time of the request on the
server.
Parameter
timestamp
An Object variable of type DateTime.
Example
The following example retrieves the date and time of the request and displays it in
the Message label control:
Sub Page_Load( )
Message.Text = "Date/Time of Request: " _
& Context.Timestamp
End Sub
Trace
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.
Parameter
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.
User
IPrincipal = Context.User
Context.User = IPrincipal
Returns or sets the IPrincipal object for the current request.