Question

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?

Was it helpful?

Solution

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

        radAjaxManager1.RequestQueueSize = 0;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top