System.ExtensionMethods.IsAjaxRequest C# (CSharp) Method

IsAjaxRequest() public static method

public static IsAjaxRequest ( this @this ) : bool
@this this
return bool
        public static bool IsAjaxRequest(this HttpRequest @this)
        {
            if (@this == null)
                throw new ArgumentNullException("request");
            if (@this.Headers["X-Requested-With"] == "XMLHttpRequest")
                return true;
            if (@this.Headers != null)
                return @this.Headers["X-Requested-With"] == "XMLHttpRequest";
            return false;
        }
    }