How can I get route values from inside my ActionExecuting filter?

前端 未结 2 1037
独厮守ぢ
独厮守ぢ 2021-01-12 22:43

How can I get route values from inside my OnActionExecuting filter method.

I had the following two suggestions but I am still confused:

  1. A
2条回答
  •  说谎
    说谎 (楼主)
    2021-01-12 23:23

    I think you're trying to preempt some controller action (like Delete) with "enter code here":

    protected override void OnActionExecuting(ActionExecutingContext filterContext)
    {
        string city = filterContext.ActionParameters["city"];
        string street = filterContext.ActionParameters["street"];
    
        // probably include this:
        //base.OnActionExecuting(filterContext);
    }
    

提交回复
热议问题