开发者

How can I get action name?

开发者 https://www.devze.com 2023-01-09 06:38 出处:网络
I replaced the ASP.NET ControllerFactory by aWindsorControllerFactory. And I registered all controllers and interceptors. Until here everything working well.

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

精彩评论

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

关注公众号