Click here to Skip to main content
15,886,083 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi friends
i am working on some project,there i got this methdod( Responce.AppendHeader(string name,string value )) in the page load
Thank u in advance
Posted
Comments
Raje_ 26-Jun-14 2:13am    
Adds an HTTP header to the output stream.

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 that pertain 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 user control sets the more restrictive header "Cache-Control: Private" via calls to SetCacheability, then the "Cache-Control: Private" header will be sent with the response.

Ref
http://msdn.microsoft.com/en-us/library/system.web.httpresponse.appendheader(v=vs.110).aspx[^]
 
Share this answer
 
First thing which comes to my mind: if you don't know why appending a header, you probably don't need it for your project (which you did not bother to talk about) :-).

I cannot understand why so clear original MSDN documentation needs some extra explanations: http://msdn.microsoft.com/en-us/library/system.web.httpresponse.appendheader%28v=vs.110%29.aspx[^].

Probably the only reason of such question could be this: you have no idea why the headers are used at all. It would mean that you should learn how HTTP works, and, in particular, the role of those headers:
http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol[^],
http://en.wikipedia.org/wiki/List_of_HTTP_header_fields[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900