In my application I need to set a http response header. I\'d like to do this in web.config.
I believe none of the answers here are comprehensive, so here's mine:
Please see my blog post on how to add a custom HTTP module to add/remove HTTP headers here. Although the issue I was trying to solve was different but I too needed to add/remove HTTP headers. A gist of the blog post is as follows:
The event to do this in is HttpContext.PreSendRequestHeaders. You can also do this from IIS settings or IIS's config as shown on IIS Knowledge base. This config file (applicationHost.config) is located at %WinDir%\System32\Inetsrv\Config\applicationHost.config for a default installation.