Skip to content

Instantly share code, notes, and snippets.

@mgroves
Created March 12, 2012 16:25
Show Gist options
  • Select an option

  • Save mgroves/2023152 to your computer and use it in GitHub Desktop.

Select an option

Save mgroves/2023152 to your computer and use it in GitHub Desktop.
OnResultExecuting Kitchen Sink
// in the controller class
[KitchenSinkresultExecutingFilter]
public ActionResult OnResultExecuting(string id, string anotherParam)
{
return View();
}
// outside the controller class
public class KitchenSinkresultExecutingFilterAttribute : ActionFilterAttribute
{
public override void OnResultExecuting(ResultExecutingContext filterContext)
{
filterContext.Controller.ViewBag.FilterContext = filterContext;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment