[英]How can I make the Telerik progress bar work?
我的項目中有一個 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);
}
}
項目構建沒有任何錯誤,但進度不會改變。 如何正確觸發進度條 animation? 如果我把這個進度條放在控件上,它會影響這個嗎?
增加循環內的ProgressContex.SecondaryValue或ProgressContex.SecondaryPercent :
for (int i = 0; i < 100; i++)
{
ProgressContex.CurrentOperationText = "Uploading zip file percentage " + i.ToString();
ProgressContex.SecondaryValue = i.ToString();
ProgressContex.SecondaryPercent = i.ToString();
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.