The cancel button doesn't work under RadProgressArea

2 posts, 0 answers
  1. Jin
    Jin avatar
    80 posts
    Member since:
    Jun 2012

    Posted 13 Aug 2012 Link to this post

    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>
  2. Plamen
    Admin
    Plamen avatar
    2958 posts

    Posted 15 Aug 2012 Link to this post

    Hello,

     
    I have tested the code locally and could not observe any unusual behavior. This issue may be caused because of some of the known limitation of RadProgerssArea that are listed here.

    Please have in mind as well that the "Cancel" button does not work in Chrome as well as Safari(the first limitation) because of the way both these browser deals with the file upload and javascript. Please excuse us for this limitation of our control.

    Hope this will be helpful.

    Regards,
    Plamen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top