Since your description (“monitoring some document processing on the server”) can map to two different scenarios in RadProgressArea, let me cover both. In both cases the recommended hook for dismissing the dialog is the OnClientProgressUpdating event, you only need to detect “100% / finished” and call sender.hide().
Scenario 1: File upload (RadAsyncUpload)
RadProgressArea automatically receives PrimaryPercent, RequestSize, file counters, etc. from the built-in upload progress channel. You just need to react when PrimaryPercent reaches 100.
<telerik:RadProgressManagerID="RadProgressManager1"runat="server" /><telerik:RadProgressAreaID="RadProgressArea1"runat="server"OnClientProgressUpdating="onUploadProgressUpdating" /><telerik:RadAsyncUploadID="RadAsyncUpload1"runat="server" /><script>functiononUploadProgressUpdating(sender, args) {
var data = args.get_progressData();
if (!data) return;
if ((data.PrimaryPercent || 0) >= 100) {
args.set_cancel(true); // skip the last visual repaintsetTimeout(function () { sender.hide(); }, 250);
}
}
</script>
When the server is doing its own long-running work (e.g. document conversion), you report progress through RadProgressContext.Current. To get the dialog to close and to stop the polling automatically, set the built-in OperationComplete = true flag at the end of your operation. RadProgressManager will then end its internal polling timer on the next callback (no further requests to Telerik.RadUploadProgressHandler.ashx).
Important: the button that triggers the operation must be inside a RadAjaxManager AJAX setting (not a full postback), so the polling can run in parallel with the work.
protectedvoidbtnStart_Click(object sender, EventArgs e)
{
var progress = RadProgressContext.Current;
constint total = 20;
progress.SecondaryTotal = total;
for (int i = 1; i <= total; i++)
{
// ... process one document ...
progress.SecondaryValue = i;
progress.SecondaryPercent = (int)(i * 100.0 / total);
progress.CurrentOperationText = string.Format("Processing document {0} of {1}", i, total);
}
// Optional custom flag for the client.
progress["IsCompleted"] = "true";
// Tells RadProgressManager to stop polling automatically.
progress.OperationComplete = true;
}
<telerik:RadAjaxManagerID="RadAjaxManager1"runat="server"OnClientResponseEnd="onResponseEnd"><AjaxSettings><telerik:AjaxSettingAjaxControlID="btnStart"><UpdatedControls><telerik:AjaxUpdatedControlControlID="lblStatus" /></UpdatedControls></telerik:AjaxSetting></AjaxSettings></telerik:RadAjaxManager><telerik:RadProgressManagerID="RadProgressManager1"runat="server" /><telerik:RadProgressAreaID="RadProgressArea1"runat="server"OnClientProgressUpdating="onServerProgressUpdating" /><telerik:RadButtonID="btnStart"runat="server"Text="Start"OnClick="btnStart_Click"OnClientClicked="onStartClick" /><asp:LabelID="lblStatus"runat="server"Text="Idle." /><script>var _done = false;
functiononStartClick(sender, args) {
_done = false;
var pa = $find("<%= RadProgressArea1.ClientID %>");
if (pa) pa.show();
}
functiononServerProgressUpdating(sender, args) {
if (_done) { args.set_cancel(true); return; }
var data = args.get_progressData();
if (!data) return;
var done = data["IsCompleted"] === "true" ||
(data.SecondaryPercent || 0) >= 100 ||
(data.PrimaryPercent || 0) >= 100;
if (done) {
_done = true;
args.set_cancel(true);
setTimeout(function () { sender.hide(); }, 250);
}
}
// Safety net — hide the dialog when the AJAX request completes,// in case the last poll did not deliver the final update.functiononResponseEnd(sender, args) {
_done = true;
var pa = $find("<%= RadProgressArea1.ClientID %>");
if (pa) pa.hide();
}
</script>
Notes that apply to both scenarios
Only oneRadProgressManager per page — it serves all RadProgressArea instances on the page.