Reputation: 32798
I have the following action:
public ActionResult Delete(string city, string street) {
Is it possible for me to get the values of the city and street parameters from inside of an OnActionExecuting filter?
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
Upvotes: 1
Views: 700
Reputation: 30152
Do you basically want access to your route values here (as opposed to parameter values in a method which you don't have direct access since that is already a 'bound' method - it essentially is the same thing though)
Access your ControllerContext in the method and that gives you access to RouteValues so filterContext.Controller.RouteValues
EDIT For completeness (based on your other post) this data is available if you want just the action parameters string city = filterContext.ActionParameters["city"];
this depends though on what you want to access as ther may be other route parameters not bound to parameter values.
Upvotes: 1