I was recently working on a page hit logging scenario that, for reasons having to do with URL rewriting, needed to have the logging code executed in the Application.BeginRequest event of Global.ajax. The application relies heavily on ASP.Net Ajax, and I needed a was to ferret out the AJAX requests and not log them. Ordinarily, in the page lifecycle, this would be accomplished by using Page.IsAsync. In this case, I needed to perform the logging prior to the page code being invoked.
To determine the whether the request was generated by AJAX, I used the following code:
Request.Headers("X-MicrosoftAjax") = "Delta=true"
Request.Headers["X-MicrosoftAjax"] = "Delta=true";
Hope that helps someone out there who has struggled to find an easy answer.