title: Getting error while using “FilterExecutingContext” , How to use ‘OnActionExecuting’ method of ActionFilterAttribute class?
body: <p>I want implement HTML compression in my project using below code.</p>
  
  <pre><code>public class CompressFilter : ActionFilterAttribute {
  
  public override void OnActionExecuting(FilterExecutingContext filterContext)
  {
      HttpRequestBase request = filterContext.HttpContext.Request;
  
      string acceptEncoding = request.Headers["Accept-Encoding"];
  
      if (string.IsNullOrEmpty(acceptEncoding)) return;
  
      acceptEncoding = acceptEncoding.ToUpperInvariant();
  
      HttpResponseBase response = filterContext.HttpContext.Response;
  
      if (acceptEncoding.Contains("GZIP"))
      {
          response.AppendHeader("Content-encoding", "gzip");
          response.Filter = new GZipStream(response.Filter, CompressionMode.Compress);
      }
      else if (acceptEncoding.Contains("DEFLATE"))
      {
          response.AppendHeader("Content-encoding", "deflate");
          response.Filter = new DeflateStream(response.Filter, CompressionMode.Compress);
      }
  }
  }
  </code></pre>
  
  <p>But, i got an error on <code>FilterExecutingContext</code>. It shows error like <code>code not found...</code> 
  So please give me suggestion how i should implement HTML compression in my project.
  And any other suggestion please tell me.</p>
  
  <p>Thanks.</p>