Created
August 1, 2012 08:34
-
-
Save wsky/3225045 to your computer and use it in GitHub Desktop.
IsXmlHttpRequest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static bool IsXmlHttpRequest(this HttpRequestBase request) | |
{ | |
var header = request.Headers["X-Requested-With"]; | |
return !string.IsNullOrEmpty(header) && header.ToLower().IndexOf("xmlhttp") >= 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Request.IsAjaxRequest()