The ASP AddHeader Method is used to specify for adding a new named for the HTTP Header and provide and given a value to the HTTP Response. It is a method of a Response type Object.
- Once a header has been added then it can not be further removed.
- This method must be called before any output is sent to the client unless the Response. Buffer is set to true.
Parameter Values: This method accepts two parameters as mentioned above and described below:
- name: It defines the name of the new header variable. The name cannot contain any underscores (_).
- value: It defines the initial value of the new header variable.
Return Values: This method has not returned any value.
<% Response.AddHeader "WARNING","Error message text %>
Example 2: Below code uses the AddHeader method to request that the client use Basic authentication.
<% Response.Addheader "WWW-Authenticate", "BASIC" %>
<% Response.AddHeader "CustomHeader", "CustomValue" %>
- Difference between ASP and ASP.NET
- ASP Flush Method
- ASP End Method
- ASP BinaryRead Method
- ASP Write() Method
- ASP BinaryWrite Method
- ASP Clear Method
- ASP AppendToLog Method
- ASP Redirect Method
- ASP Contents.Remove Method
- Difference Between HTML and ASP
- Difference between JSP and ASP
- Difference Between Node.js and Asp.net
- ASP Full Form
- Inline HTML Helper - HTML Helpers in ASP.NET MVC
- ASP Buffer Property
- ASP ContentType Property
- ASP CacheControl Property
- ASP Expires Property
- ASP ExpiresAbsolute Property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.