
368
|
Chapter 17: The HttpResponse Class
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Parameter
Integer
An integer variable to set or receive the status code. The default is 200. The
possible status codes fall into the following ranges:
1xx
The 100 range is for informational messages.
2xx
The 200 range is for success messages.
3xx
The 300 range is for redirection messages. The specific status code indi-
cates whether a page has been moved temporarily or permanently.
4xx
The 400 range is for client error messages. The best-known message is
the 404 Not Found message, which indicates that the client has asked for
a resource that does not exist on the server. This range also includes
status error messages related to client authentication.
5xx
The 500 range is for server error messages. For example, if more requests
are received by IIS then can be processed or queued for later processing,
clients will receive a 500-series status code with the “Server Too Busy”
message.
Example
The example uses the StatusCode and StatusDescription properties to send an
HTTP status message to the client. The Response.End method halts further
processing and sends the currently buffered output to the client.
Sub Page_Load( )
Response.StatusCode = 542
Response.StatusDescription = "Server Error - The code is the answer."
Response.End( )
End Sub
Notes
As with other properties ...