The AddHeader method adds a new named HTTP header with a specific value to the HTTP response.
HTTP headers are just lines of text sent from the server to the browser before the page content.
For examples of HTTP headers plz check:
http://www.edginet.org/techie/website/http.html
2007-05-19 22:09:14
·
answer #1
·
answered by Smutty 6
·
0⤊
0⤋
Straight from the MS Help files:
AddHeader:
AddHeader is the same as AppendHeader and is provided only for compatibility with previous versions of ASP. With ASP.NET, use AppendHeader.
AppendHeader:
If you use the AppendHeader method to send cache-specific headers and at the same time use the cache object model (Cache) to set cache policy, HTTP response headers pertaining to caching (Cache-Control, Expires, Last-Modified, Pragma, and Vary) might be deleted when the cache object model is used. This behavior enables ASP.NET to maintain the most restrictive settings. For example, consider a page that includes user controls. If those controls have conflicting cache policies, the most restrictive cache policy will be used. If one user control sets the header " Cache-Control: Public " and another sets the more restrictive header " Cache-Control: Private " via calls to SetCacheability, then the " Cache-Control: Private " header will be sent with the response.
It rarely gets used. Typically where you need absolute control over what gets sent to the browser. For example, I need to store my downloadable files somewhere where the visitors do not have direct access to them (we sell them), so in the script that delivers the files to the browser, I have this:
Response.AddHeader "Content-Disposition", "attachment; filename=" & FileName
Response.AddHeader "Content-Length", strFileSize
Response.ContentType = "application/pdf"
That makes sure that the browser knows that a download of a PDF file is coming, and what size it is, and what to do with it.
2007-05-18 07:15:24
·
answer #2
·
answered by Michael B 3
·
2⤊
0⤋
The AddHeader method adds a new named HTTP header with a specific value to the HTTP response.
HTTP headers are just lines of text sent from the server to the browser before the page content.
For examples of HTTP headers plz check:
http://www.edginet.org/techie/website/ht...
2007-05-20 00:32:50
·
answer #3
·
answered by Anonymous
·
0⤊
0⤋
Response.addheader
2016-10-05 09:38:52
·
answer #4
·
answered by ? 4
·
0⤊
0⤋
The above answer is right on, but your book is incorrect on the location of aspnet_regiis.exe. It can be found here: C:\WINDOWS\Microsoft.NET\Framework\\aspnet_regiis.exe
2016-03-19 05:07:46
·
answer #5
·
answered by Anonymous
·
0⤊
0⤋
This link may answer your question
2007-05-18 03:15:39
·
answer #6
·
answered by AnalProgrammer 7
·
0⤊
0⤋