does 'response.clear()' remove content and

2019-06-24 09:51发布

问题:

I need to know if Response.Clear() just clear content or it also remove the headers? in other word if I use Response.Clear(), do I also need to use Response.ClearHeader() or not ?

回答1:

AS MSDN SAYS

The Clear method erases any buffered HTML output. However, the Clear method erases only the response body; it does not erase response headers.

To clear header use Response.ClearHeaders();