0

In Asp.Net Core, How it's possible to get the current area name in the OnActionExecuting method of action filter?

I tried the below statement, but it's returning me null at all times.

var area = context.RouteData.DataTokens["area"];
anand
  • 577
  • 6
  • 11

1 Answers1

0

Got the solution and working with Asp.Net core 5.0 also:

ViewContext?.ActionDescriptor?.RouteValues["area"]

Thanks, https://stackoverflow.com/a/55025419/1596971

anand
  • 577
  • 6
  • 11