I\'ve got the following filter in place on an action to capture the HTML output, convert it to a string, do some operations to modify the string, and return a ContentResult
Can you verify that stream is not NULL in the OnActionExectuted-method? I'm not sure the state of the stream-variable is being stored through the process..
Why don't you try to get the stream out of the filterContext:
public override void OnActionExecuted(ActionExecutedContext filterContext)
{
var stream = filterContext.HttpContext.Response.Filter;
string response = new StreamReader(stream).ReadToEnd();
ContentResult contres = new ContentResult();
contres.Content = response;
filterContext.Result = contres;
}