I am in a need to intercept all of the html that will be sent to the browser and replace some tags that are there. this will need to be done globally and for every view. wha
The answer is correct but. After using it for a while I came across a case when the response is split in many parts so that html is incorrect
Part 1:
..... ...
Also partial renders may make unexpected cases. Their html is out of the main stream too. So my solution is to do it in the Flush method after all streaming is done.
///
/// Insert messages and script to display on client when a partial view is returned
///
private class ResponseFilter : MemoryStream
{
private readonly Stream _response;
private readonly IList