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:
I would like to abandon/abort the first event when a subsequent event is clicked. Is this possible?
I figured out it's possible with Telerik, by setting the Queue Size of the rad Ajax Manager to 0:
radAjaxManager1.RequestQueueSize = 0;