The manual Page
Version française
     Method Response.AddHeader  
[ 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.AddHeader Name, Value

This method adds the HTTP directive Name with the value Value in the HTTP headers of the response.

Once a haeder has been added, it cannot be removed.

This method must be called before sending any kind of content (especially HTML code) to the client, unless the output buffer has been activated (in this latter case, AddHeader must be called before the first call to Response.Flush).

Example

In the following example, we are going to ask the client not to cache the actual document (an HTTP directive "Pragma: no-cache" is going to be added in the HTTP headers of the response):

<%
' We call AddHeader at the very beginning to avoid troubles
Response.AddHeader "Pragma", "no-cache"
...
%>
<HTML>
<HEAD>
...
</HTML>

We can also do the following of we activate the output buffer:

<%
' We activate the output buffer
Response.Buffer = True
...
%>
<HTML>
<HEAD>
...
</HTML>
<%
' Finally, we call AddHeader
Response.AddHeader "Pragma", "no-cache"
%>

List of all HTTP/1.1 directives List of all HTTP/1.1 directives

printable format printable format



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