0

Is there a way to get the ASP.NET MVC area in the global.asax, specficially the method below?

public override string GetVaryByCustomString(HttpContext context, string arg)
        {
            if (arg.ToLower() == "username" && context.User.Identity.IsAuthenticated) return context.User.Identity.Name;
       
            return base.GetVaryByCustomString(context, arg);
        }
Mike Flynn
  • 22,342
  • 54
  • 182
  • 341

1 Answers1

1

Have you tried the solution found in this question/answer?

HttpContext.Current.Request.RequestContext.RouteData.DataTokens["area"]

Tim
  • 2,587
  • 13
  • 18