The way to tell if the page is in an AJAX call is to check the ScriptManager.IsInAsyncPostBack property.
Sounds trivial.
The only reason I am writting about that is the very common confusion with the Page.IsAsync property that has absolutely nothing to do with AJAX.