This is a migrated thread and some comments may be shown as answers.

what is the correct property to check whether the current page is in the process of performing Asynchronous PostBack?

3 Answers 76 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Hadi Teo
Top achievements
Rank 1
Hadi Teo asked on 02 May 2009, 09:43 AM
Hi,

Currently i am using WatiN to perform automated test against my ASP.NET web app. Telerik RadAjax control is used to help me perform Ajax Request between client side and server side.

Currently when i simulate the search button click on the client side, to retrieve the table result from the server and populate back at the client using RadGrid, WatiN process my test code line synchronously, so it won't see the result, as the Ajax Call is asynchronous.

I have encountered this page : http://pushpontech.blogspot.com/2008/04/ajax-issues-with-watin.html . and it's almost answering my issue, by checking whether the page is in asynchronous postback mode or not.

May i know how to perform the same checking using RadAjax, because it seems that i cannot find the correct API in the Client-Side API of RadAjax.

Thanks very much for all your help.

hadi teo

3 Answers, 1 is accepted

Sort by
0
Serrin
Top achievements
Rank 1
answered on 04 May 2009, 12:36 PM
Hello Hadi,

I'm not the most experienced with doing this sort of thing with RadAjax, but would it be possible to set a flag on OnRequestStart and then clean it on OnResponseEnd?  This way, all you'd ever need to do is check for that flag being raised and you'll know you're in the middle of an async request.

Not sure how well that would work with WatiN, but in looking at the RadAjax client-side members I cannot find an equivelant to IsInAsyncPostback... but then again, since RadControls are built on top of MS Ajax, wouldn't you still have access to the page commands that pushp is referring to?

0
Hadi Teo
Top achievements
Rank 1
answered on 05 May 2009, 01:43 AM
Hi Serrin,

Thanks for your workaround to set a variable on the onRequestStart event and reset that back in onResponseEnd.

I will check also regarding the ASP.NET ajax property.

Regards,

hadi teo.
0
Gururaj
Top achievements
Rank 1
answered on 12 Jun 2009, 06:50 AM

Well, you don't need to OnRequestStart / OnResponseEnd for finding whether the request is Ajax or not.

You need to put RadAjaxManager on the .aspx page and use the IsAjaxRequest property of  RadAjaxManager to check it. This will solve your issue.

 

 

Regards,
Gururaj Nagalli

Tags
Ajax
Asked by
Hadi Teo
Top achievements
Rank 1
Answers by
Serrin
Top achievements
Rank 1
Hadi Teo
Top achievements
Rank 1
Gururaj
Top achievements
Rank 1
Share this question
or