public override void ProcessRequest(HttpContext context) { if (context.Request.Headers["Accept"].IndexOf("application/json") > -1) { try { ProcessAjaxRequest(context); } catch (Exception ex) { WebUtil.WriteJsonError(context, ErrorCode.ServerError, ex.Message); } } else { base.ProcessRequest(context); } }
protected virtual void ProcessAjaxRequest(HttpContext context, string action) { WebUtil.WriteJsonError(context, ErrorCode.InvalideRequest, "Not Implemented Ajax Request. Action: " + action); }