title: How to mimic ActionFilter Attribute in Asp.net web form
body: <p>In MVC user can use action filter like this:</p>
  
  <pre><code>[Log]
  ActionResult Home()
  {
       return View();
  }
  </code></pre>
  
  <p>Now I am going to find equivalent for ActionFilter in asp.net web form. How I can mimic that like above for asp.net web form and apply them to event handlers?</p>
  
  <pre><code>[Log]
  protect void btnSearch_Click(object sender, EventArgs e)
  {
       //Do some operations here
  }
  </code></pre>
  
  <p><strong>Update:</strong></p>
  
  <p>To clarify my question (As comment says my question is a little ambiguous), I want to log start of method and ending of method. In Mvc I can create Action Filter like this:</p>
  
  <pre><code>public class LogAttribute : ActionFilterAttribute
  {
      public override void OnActionExecuting(ActionExecutingContext filterContext)
      {
          //Logging start of method.
      }
  
      public override void OnActionExecuted(ActionExecutedContext filterContext)
      {
          //Logging end of method.
      }
  }
  </code></pre>