0

Is there a way to determine whether an OnActionExecuting(ActionExecutingContext filterContext) request is coming from the server or client?

keenns
  • 863
  • 4
  • 14
  • 26

1 Answers1

0

I'm not totally sure this is completely correct, but the answer may be:

var requester = filterContext.HttpContext.Request.UrlReferrer == null ? "client" : "server";

(I.e. if there is a referrer url, then it's a server request, if there isn't it's a client request)

keenns
  • 863
  • 4
  • 14
  • 26