Created
March 12, 2012 16:25
-
-
Save mgroves/2023152 to your computer and use it in GitHub Desktop.
OnResultExecuting Kitchen Sink
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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