
IsAuthenticated | 331
HttpRequest
Class
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
The following code can be used to post to the example page:
<html>
<head>
</head>
<body>
<form id="form1" action="InputStream.aspx" method="POST">
<h3>Name:</h3>
<input type="text" name="name">
<input type="submit">
</form>
</body>
</html>
The code returns as output the first capital A appearing in the request body. Any
characters after it are returned to the end of the stream.
Notes
This property is useful if you wish to perform byte-level filtering of the request
body. It works only with POST requests, since these requests are the only
commonly used HTTP requests that provide a request body.
IsAuthenticated
boolvar = Request.IsAuthenticated
Returns a Boolean indicating whether the current request is coming from a user
who is authenticated. This property refers to authentication against the NTLM
account database.
Parameter
boolvar
A Boolean variable to receive the authentication status of the user.
Example
The example checks to see if the current user is authenticated and it outputs one
of two messages, depending on the authentication status of the user. Note that the
message delivered to authenticated users utilizes the User property of the page to
output the current user’s name and domain.
Sub Page_Load( )
Dim boolAuth As Boolean
boolAuth = Request.IsAuthenticated ...