Is it possible to add response http headers in web.config?

后端 未结 6 954
挽巷
挽巷 2020-12-29 02:35

In my application I need to set a http response header. I\'d like to do this in web.config.

6条回答
  •  隐瞒了意图╮
    2020-12-29 03:20

    I'm not aware that you can do it on the web.config

    So far I know the best options you have are:

    • Create an HTTPModule where you set the header for all responses
    • Add the header on the IIS

    Here you have the reference on MSDN:

    Custom HttpModule Example

    This link has an implementation of an HTTPModule that seems to be what you need

    http://idunno.org/archive/2006/08/01/252.aspx

提交回复
热议问题