Reputation: 131
I have used Response.ClearHeaders();
in a Controller action method. But it returns an error like:
'HttpResponse' does not contain a definition for 'ClearHeaders' and no accessible extension method 'ClearHeaders' accepting a first argument of type 'HttpResponse' could be found (are you missing a using directive or an assembly reference?)
Can you please help on this?
Upvotes: 0
Views: 922
Reputation: 31228
Use the Response.Clear()
extension method instead.
This invocation resets the response headers, response status code, and response body.
Upvotes: 1