I have a button and a RadProgressArea button in one page to execute a batch job. When I click the button and wait for some time, I click the cancel button, it have no any response. Anybody know why?
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
RadProgressArea1.Localization.UploadedFiles = "Completed Steps: ";
RadProgressArea1.Localization.CurrentFileName = "Step: ";
RadProgressArea1.Localization.TotalFiles = "Total Steps:";
}
}
protected void RadButtonProcess_Click(object sender, EventArgs e)
{
RadProgressContext context = RadProgressContext.Current;
context.SecondaryTotal = "100";
for (int i = 1; i < 100; i++)
{
context.SecondaryValue = i.ToString();
context.SecondaryPercent = i.ToString();
context.CurrentOperationText = "Doing step " + i.ToString();
if (!Response.IsClientConnected)
{
//Cancel button was clicked or the browser was closed, so stop processing
break;
}
// simulate a long time performing the current step
System.Threading.Thread.Sleep(100);
}
}
<telerik:RadProgressManager runat="server" ID="RadProgressManagerCode" />
<telerik:RadProgressArea ID="RadProgressArea1" runat="server" DisplayCancelButton="True"
ProgressIndicators="FilesCountBar,
FilesCountPercent,
SelectedFilesCount,
CurrentFileName,
TimeElapsed">
</telerik:RadProgressArea>
<telerik:RadButton ID="RadButtonProcess" runat="server" Text="Process Comparision"
OnClick="RadButtonProcess_Click">
<Icon PrimaryIconCssClass="rbConfig" PrimaryIconLeft="4" SecondaryIconTop="4" />
</telerik:RadButton>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
RadProgressArea1.Localization.UploadedFiles = "Completed Steps: ";
RadProgressArea1.Localization.CurrentFileName = "Step: ";
RadProgressArea1.Localization.TotalFiles = "Total Steps:";
}
}
protected void RadButtonProcess_Click(object sender, EventArgs e)
{
RadProgressContext context = RadProgressContext.Current;
context.SecondaryTotal = "100";
for (int i = 1; i < 100; i++)
{
context.SecondaryValue = i.ToString();
context.SecondaryPercent = i.ToString();
context.CurrentOperationText = "Doing step " + i.ToString();
if (!Response.IsClientConnected)
{
//Cancel button was clicked or the browser was closed, so stop processing
break;
}
// simulate a long time performing the current step
System.Threading.Thread.Sleep(100);
}
}
<telerik:RadProgressManager runat="server" ID="RadProgressManagerCode" />
<telerik:RadProgressArea ID="RadProgressArea1" runat="server" DisplayCancelButton="True"
ProgressIndicators="FilesCountBar,
FilesCountPercent,
SelectedFilesCount,
CurrentFileName,
TimeElapsed">
</telerik:RadProgressArea>
<telerik:RadButton ID="RadButtonProcess" runat="server" Text="Process Comparision"
OnClick="RadButtonProcess_Click">
<Icon PrimaryIconCssClass="rbConfig" PrimaryIconLeft="4" SecondaryIconTop="4" />
</telerik:RadButton>