We discovered that the WaitForAjax method just waits for a postback within the current frame while today's applications fire postbacks across all existing frames. WaitForAjax should check all frames and not return until there is no Аjax running in any frame. Because of this I needed to use Thread.Sleep very often.