How to know if the request is ajax in asp.net in Application_Error()
I want to handle app error in Application_Error().If the request is ajax and some exception is t
You could use this.
private static bool IsAjaxRequest() { return HttpContext.Current.Request.Headers["X-Requested-With"] == "XMLHttpRequest"; }