开发者

How can I get action name?

I replaced the ASP.NET ControllerFactory by a WindsorControllerFactory.

And I registered all controllers and interceptors. Until here everything working well.

Now when I am debuging my Interceptor I always get Execute from ControllerBase in invocation.Method.Name. I need to get the action name and the parameters of the action to do some validations.

开发者_StackOverflow中文版

How can I get the action name and the action parameters in the Intercept method of my Interceptor? The information of ControllerBase_Execute method and his parameters don't help me.

Thanks,

Raphael Molesim


I believe you can get that from the RequestContext.RouteData collection. I think the keys for the method/action is "action". Something like:

requestContext.RouteData.Values["action"]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜