adding context.Response.Headers.Add("Cache-Control", "no-cache"); says IIS integrated pipeline required? adding context.Response.Headers.Add("Cache-Control", "no-cache"); says IIS integrated pipeline required? ajax ajax

adding context.Response.Headers.Add("Cache-Control", "no-cache"); says IIS integrated pipeline required?


@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.