up vote 0 down vote favorite

Does anyone know the script necessary to check to see if you are in a anync postback via JavaScript?

Thanks.

link|flag

70% accept rate
Are you trying to perform this check client side or server side? – AdamRalph Feb 6 '09 at 10:43

2 Answers

up vote 2 down vote accepted

In the end I used the following which gave me the functionality I required:

Sys.WebForms.PageRequestManager.getInstance()._postBackSettings.async

link|flag
1  
Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack() is the public documented accessor and should be used instead. Thanks however, I didn't manage to find it before your post. – Julien Lebosquain May 28 at 14:46
up vote 0 down vote

Most libraries (jquery etc) set the X-Requested-With header to XMLHttpRequest so you could test for this in the request object, however you do not say your using msajax, jquery or custom script to do the xhr calls. If you give more detail I can advise better.

Other info here that may help you

link|flag

Your Answer

get an OpenID
or
never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.