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

OnResponseEnd firing multiple times

4 Answers 135 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
StephenWRogers
Top achievements
Rank 1
StephenWRogers asked on 03 Jul 2008, 01:25 PM
I have a problem which I can simplify down to the following:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
<head runat="server"
    <title>Untitled Page</title> 
</head> 
<body> 
    <script type="text/javascript"
        function responseEnd(sender, eventArgs) 
        { 
            alert(eventArgs.get_eventArgument()); 
        } 
        function firePostBack(arg) 
        { 
            $find('<%=ajaxManager.ClientID %>').ajaxRequestWithTarget('<%=ajaxManager.ClientID %>', arg); 
            $find('<%=ajaxManager.ClientID %>').ajaxRequestWithTarget('<%=div.ClientID %>', arg); 
        } 
    </script> 
    <form id="form1" runat="server"
        <asp:ScriptManager ID="ScriptManager1" runat="server" /> 
        <div> 
            <telerik:RadAjaxManager RequestQueueSize="2" ID="ajaxManager" runat="server" ClientEvents-OnResponseEnd="responseEnd"
                <AjaxSettings> 
                    <telerik:AjaxSetting AjaxControlID="ajaxManager"
                        <UpdatedControls> 
                            <telerik:AjaxUpdatedControl ControlID="div" /> 
                        </UpdatedControls> 
                    </telerik:AjaxSetting> 
                </AjaxSettings> 
            </telerik:RadAjaxManager> 
        </div> 
        <div id="div" runat="server"></div> 
        <href="#" onclick="firePostBack('1');return false;">Fire</a> 
    </form> 
</body> 
</html> 
 

Basically, I am firing multiple ajax requests (with ajaxRequestWithTarget) and the OnResponseEnd method is firing more and more times the more you fire the requests. 

If you create a page using the code above, the first time you press "Fire" OnResponseEnd fires 3 times, the next time it fires 5, the next time 7, etc.

Equally if you change the ajaxRequestWithTarget to ajaxRequest, the responseEnd fires twice, four times, six times, eight time etc.  This only seems to occur with multiple ajax requests.


I'm seeing old ajaxrequests that have finished keep firing the OnResponseEnd event - surely this isn't right?

Thanks,

Stephen


4 Answers, 1 is accepted

Sort by
0
Pavel
Telerik team
answered on 08 Jul 2008, 06:01 AM
Hello Stephen,

Indeed you are right and OnResponseEnd is fired multiple times on the client in this scenario. Note that on the server only 2 ajax requests are executed. I have notified our developers and they will look into the matter. As a small gratitude for bringing this problem to our attention I have updated your Telerik points.

Kind regards,
Pavel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
StephenWRogers
Top achievements
Rank 1
answered on 29 Jul 2008, 03:36 PM
Is there any news on this?  I think the problem persists in the latest version, are there any plans to have this fixed in the next service pack?

Thanks,

Stephen
0
Vlad
Telerik team
answered on 01 Aug 2008, 07:13 AM
Hello Stephen,

We will do our best to provide fix for this for our first service pack - end of August.

Kind regards,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Andreas
Top achievements
Rank 1
answered on 04 Dec 2008, 01:15 PM
Any news on this topic?

Having the same problem, lots more End events than Start events.

Ex.: (complex ajaxified tabbed application)
first ajax request: 2 start - 3 end
second ajax request: 2 start - 5 end
third ajax request: 2 start - 7 end
third ajax request: 2 start - 9 end

// Andreas Clausen
Tags
Ajax
Asked by
StephenWRogers
Top achievements
Rank 1
Answers by
Pavel
Telerik team
StephenWRogers
Top achievements
Rank 1
Vlad
Telerik team
Andreas
Top achievements
Rank 1
Share this question
or