2

I've got a C# web application that presents the user with reports, occasionaly the reports take in the neighbourhood of several minutes to generate (instead of a few seconds).

I have a RadTreeView of "ReportType" links, when clicked executes a RadAjaxRequest using the RadAjaxManager from the client-side.

function RadTreeviewNodeClicked(sender, eventArgs) {
            try {
                console.log("fired again: " + eventArgs.get_node().get_text());
                var radAjaxManager = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>");
                radAjaxManager.ajaxRequest("NodeClicked");
            } catch (error) {
                console.log("error on nodeclicked");
            }
        }

 //from my pageload
 radAjaxManager1 = RadAjaxManager.GetCurrent(Page);
 radAjaxManager1.AjaxRequest += RadAjaxManager1_AjaxRequest;
 radAjaxManager1.ResponseScripts.Add("AttachJQueryUIDateTimePickers();");
 radAjaxManager1.AjaxSettings.AddAjaxSetting(radAjaxManager1,pnlRightContent,RadAjaxLoadingPanel1);
 radAjaxManager1.ClientEvents.OnResponseEnd = "ResponseEnd";

The ajaxRequest handler on the server loads up the appropriate report for the link that was clicked and displays it on the right hand side in an asp:panel. The menu and panel are both wrapped in a RadAjaxPanel.

If the report data is still loading (the stored procedure is executing) and a user clicks another link:

  • the client event is triggered
  • the server finishes the first event
  • the respondeEnd event is fired
  • the server starts processing the 2nd event

I would like to abandon/abort the first event when a subsequent event is clicked. Is this possible?

Arun Bertil
  • 4,598
  • 4
  • 33
  • 59
Brian Garson
  • 1,160
  • 6
  • 11

1 Answers1

0

I figured out it's possible with Telerik, by setting the Queue Size of the rad Ajax Manager to 0:

        radAjaxManager1.RequestQueueSize = 0;
Brian Garson
  • 1,160
  • 6
  • 11
  • My page had RadAjaxManagerProxy, didn't see the property there. I found it on RadAjaxPanel I was using, but setting it to 0 didn't cancel the ajax request for me. It still seems to still wait for it to come back before it processes my redirect – unnknown Oct 11 '16 at 19:47