views:

19

answers:

0

I've tried to call controller action from filter. But i've discovered that if i want to do that i had to..

var controller = new MyController();
controller.ControllerContext = filterContext.Controller.ControllerContext;
controller.<action>(<parameters>); // it's action which accepts only POST, but here it doesn't matter
base.OnActionExecuting(filterContext);

How can i call controler from CURRENT CONTEXT.

I don't want to create new controller. Is there any way to access controller in current httpContext?? Above i had to change ControllerContext and i'm wondering is there any way to not do that.