I read somewhere that you cannot delete response headers after adding them. Given this, I am wondering where in the standard ASP.NET web form application, response headers are first added. For example, they:
Date Fri, 23 Apr 2010 16:25:56 GMT Server Microsoft-IIS/6.0 X-Powered-By ASP.NET Cache-Control private
And can I stop it? Do subsequent headers write down old headers? Does my question make sense?
The headers you mentioned are automatically added by IIS. Instructions for changing them can be found on the question posted on Serverfault here .
But to answer your question about when, I believe, you remember that you are reading incorrectly.
I believe that you mean that you cannot change the http headers after the content has been sent back to the browser . This will happen in the Rendering event or as soon as you use the Response.Write or Response.Redirect method.
Edit - Added
By the way, there are a few things you cannot do once the headers are sent ... Modifying cookies with Response.Redirect, etc.
See these links:
Why do I get "Can't redirect after sending HTTP headers" when I call Response.Redirect ()?
http://www.bing.com/search?q=HTTP+headershave+been+sent&src=IE-SearchBox&FORM=IE8SRC
Added even more
And finally, the best answer. I was looking for an event in the life cycle of the page where the HTTP headers are sent. In fact, they are dispatched by the HttpApplication object. The event that fires before this is the PreSendRequestHeaders event in this article .
The X-Powered-By: ASP.NET header is added by IIS. You can remove this globally or based on each site by editing the "Custom HTTP Headers" on the "HTTP Headers" tab.
X-Powered-By: ASP.NET
Source: https://habr.com/ru/post/1307797/More articles:Emulating client activity by calling the dumping method to register and simulate usage in java - javaDownloading files with ColdFusion, too little time? - coldfusionVisual Studio 2008 checkpoint not working - c #Java exception handling in unclassified tasks (template / good practice) - javaFormula for real-time video streaming - streamGNU make variables in Makefile - variablesWindows batch file for a list of folders that have a specific file - command-lineHow can I reset addAttributeToFilter in Magento search - loopsView.StateMode Property in Asp.Net 4.0 - .netHow to sort NSMutableArray objects by a member of its class, which is int or float - sortingAll Articles