The manual Page
Version française
     Property Response.Status  
[ index | glossary | news | downloads | links ]
 
  introduction to ASP
writting in ASP
ASP variables
the ASP 3.0 objects
the object Request
   .TotalBytes
   .ClientCertificate
   .Cookies
   .Form
   .QueryString
   .ServerVariables
   .BinaryRead
the object Response
   .Status
   .Cookies
   .AddHeader
   .AppendToLog
   .BinaryWrite
   .Clear
   .End
   .Flush
   .Redirect
   .Write
 
news
glossary
downloads
 
guest book
credits
contact
 
 
research
 
last update
25/03/2002
Valid HTML 4.0!
Valid CSS!
Hit-Parade
Measure your audience

Synopsis

Response.Status

This method is used to define the HTTP status of the response. The status must be provided in its complete form: xxx description, with xxx the 3-digit code of the status.

As the status lies on the very first line of the server's response, Response.Status must be set before the body of the response is returned (if you use the output buffer, Response.Status must be set before the very first call of Reponse.Flush).

Example

In the following example, we are going to use Response.Status and the HTTP status to allow or not a client to access the current page; 192.168.1.1 is the only allowed IP address:

<%
IPAddress = Request.ServerVariables("REMOTE_ADDR")
If IPAddress <> "192.168.1.1" Then
	Response.Status = "403 Access Forbidden"
	Response.Write("You are not allowed to read this page")
' The access is refused: the actual page must not be returned
	Response.End
End If
%>


You can access this page

List of all HTTP/1.1 status List of all HTTP/1.1 status

printable format printable format



Copyright © 2000-2002 themanualpage.org - This site is submissive to the terms of the GNU GPL and FDL licences.