如何使Telerik进度条工作

本文关键字:工作 何使 Telerik | 更新日期: 2023-09-27 17:58:32

我的项目中有一个Telerik进度条:

<telerik:RadProgressManager ID="RadProgressManager" Runat="server" />
<telerik:RadProgressArea ID="RadProgressArea" Runat="server"></telerik:RadProgressArea>   
<asp:button id="Button1" runat="server" text="Submit" />

点击按钮,我尝试运行这种方法:

private void MethodWhichUpdatesTheProgressContext(UploadedFile file, int countFile)
{
     const int total = 100;
     RadProgressContext ProgressContex = RadProgressContext.Current;
     ProgressContex.SecondaryTotal = "100";
     for (int i = 0; i < total; i++)
     {
         ProgressContex.CurrentOperationText = "Uploading zip file percentage " + i.ToString();                
         if (!Response.IsClientConnected)
         {                    
             break;
         }
         System.Threading.Thread.Sleep(100);
     }
}

项目生成时没有任何错误,但进度不会更改。如何正确地启动进度条动画?如果我控制这个进度条,它能影响这个吗?

如何使Telerik进度条工作

在循环内增加ProgressContex.SecondaryValueProgresContex.ScendaryPercent

    for (int i = 0; i < 100; i++)
    {
        ProgressContex.CurrentOperationText = "Uploading zip file percentage " + i.ToString();
        ProgressContex.SecondaryValue = i.ToString();
        ProgressContex.SecondaryPercent = i.ToString();
    }

另请参阅:

RadProgressArea自定义进度