Note: Method is static so it can be directly accessed from anywhere. If you use the IsMsAjax property to check the value this method fires only once per application.
public static bool IsMsAjax();