Not sure if this makes sense, but why did adding the code on my http handler (responds to a ajax request returning a json result):
adding context.Response.Headers.Add("Cache-Control", "no-cache");
cause an error and say integrated pipeline mode has to be set?
@homestead, you are doing wrong, you cannot set headers this way, microsoft says:
"The Headers property is only supported with the IIS 7.0 integrated pipeline mode and at least the .NET Framework 3.0. When you try to access the Headers property and either of these two conditions is not met, a PlatformNotSupportedException is thrown."
So, if you want to set headers you have to use context.Response.AddHeader("headerName", "someValue");
instead and your code should add the header successfully.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With