Everything2
Near Matches
Ignore Exact
Full Text
Everything2

Response.AddHeader

created by yossarianc

(idea) by yossarianc (1.1 mon) (print)   ?   (I like it!) Thu Oct 11 2001 at 0:08:35

ASP Response Object : AddHeader Method

The AddHeader method adds a HTML header with the specified value. It will not replace an existing header of the same name. Once a header has been added, it cannot be removed.

The method takes two mandatory arguments:

  • Name - The name of the new header variable. This name should not contain any underscores (_).
  • Value - The initial value of the new header variable.

Since the HTTP protocol requires that all headers be sent before content, you must not make any AddHeader method calls after your ASP script generates any output. If buffering is on (see Response.Buffer), then the AddHeader method may be called at any point before a call to Response.Flush.

Example:

<%
  Response.Buffer = True
  Response.Write "Hello World!"
  Response.AddHeader "MyHeader", "This is my header!"
  Response.Flush
%>
The above code is legal because buffering is on1. However, if Response.Buffer was instead set to False then the code would generate an error message.


Back to the ASP Response Object
Back to ASP Objects
1 Buffering is on by default on IIS 5.0

Resources:
http://www.devguru.com/
http://msdn.microsoft.com/asp/

All code is my own (and despite what CNN says, is not involved with the Taliban).

printable version
chaos

ASP Objects Active Server Pages Request.ServerVariables Response.Clear
comma-delimited Real Life Hello World Referrer
mezcal IIS response error message
Response.Buffer Script Protocol underscore
mandatory Header HTML micro$oft
MS ASP scripting VBScript
Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.
  Epicenter
Login
Password

password reminder
register

Everything2 Help

Cool Staff Picks
Nodes to live by:
ebola
Gone in Sixty Seconds 2006 - Theatre Quest Entries
Surviving a long-distance plane flight
The Vagina Monologues
King Kong
Three Mile Island
Mayfly
Why are chimneys being demolished?
Multiple Sclerosis
Body language
one-dimensional cellular automaton
Bert Kaempfert
Glossary of Genetics terms
New Writeups
TheOrientalAfrican
ToTheGuyWithAidsSittingN... (I Am Really Really Sorry)(person)
Heitah
Why I love Everything2(person)
trixingee
Dungeon Mastering for the first time(idea)
Netrat0
It's Called Subtext, Honey(person)
eyeofthebeholder
The Dragon(idea)
Heitah
consist, comprise, constitute, or compose(idea)
Meezzio
Gotlandssnus(thing)
argv
Astral Plane(idea)
Madara
One Winged Angel(fiction)
Tom Rook
Talk is cheap(poetry)
shaogo
Adelle Davis(person)
Aerobe
race car g sfjsgsd(poetry)
Binah
Dream Log: July 5, 2008(dream)
StrawberryFrog
Forgotten things in space(idea)
antigravpussy
velvet revolution fairy tale(idea)
This page courtesy of The Everything Development Company