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

OnResponseEnd EventArgument has an equal value for all requests

2 Answers 94 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Igor
Top achievements
Rank 1
Igor asked on 23 Mar 2009, 11:59 AM
I use RadControls for ASPNET AJAX Q2 2008.
For some purposes I need to process all OnResponseEnd events of RadAjaxManager.
I've sent several ajax requests by client API and OnResponseEnd event raises for all requests immediately and EventArgument in the event handler has an equal value for all requests.
function SendAJAX() { 
    var ajaxMgr = $find("<%=radAjaxMgr.ClientID %>"); 
    ajaxMgr.ajaxRequest("first$argument"); 
    ajaxMgr.ajaxRequest("second$argument"); 
 
function ResponseEnd(sender, args) { 
    alert(args.EventArgument); 

<telerik:RadAjaxManager RequestQueueSize="1" runat="server" ID="radAjaxMgr" UpdatePanelsRenderMode="Inline"
    <ClientEvents OnResponseEnd="ResponseEnd" /> 
</telerik:RadAjaxManager> 

So all alerts show "second$argument". Especially if the first request didn't finish yet.
Question is why EventArgument has an equal value for all requests. And why OnResponseEnd raises immediately (not waiting for real response) after calling ajaxMgr.ajaxRequest(...)?

Thank you!


2 Answers, 1 is accepted

Sort by
0
Accepted
Iana Tsolova
Telerik team
answered on 25 Mar 2009, 02:36 PM
Hi Igor,

Indeed, it is not suggested to make such subsequent ajax requests. Thus the second request is being initiated before the first finishes, the ajax argument is set to this passed through the second request. That is why the alert display only the second argument message.
I suggest that you check out the attached sample and see if this sample implementation of the scenario works for you.

Sincerely yours,
Iana
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Igor
Top achievements
Rank 1
answered on 25 Mar 2009, 04:48 PM
It's a great!
I've similar invention already. But your decision is more friendly.

Thank you very much!
Tags
Ajax
Asked by
Igor
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Igor
Top achievements
Rank 1
Share this question
or