public override void OnActionExecuting(ActionExecutingContext filterContext) { var authenticateKey = filterContext.HttpContext.Request.Headers["AuthenticateKey"]; if (String.IsNullOrEmpty(authenticateKey)) { base.OnActionExecuting(filterContext); } else { filterContext.Result = new JsonResult(new { HttpStatusCode.Unauthorized });
//Instead of jsonresult, here I want to return response Unauthorized to browser } }
↧
How to return Unauthorized result in OnActionExecuting method
↧