在 ASP.NET AJAX 中,当我单击一个按钮时,会调用一个昂贵的进度,大约 100 多个项目是一个循环的进度,一个接一个。在进度运行时,如何在按钮的文本上显示百分比文本?
例如:
protected void btn_ExpensiveProcess_Click(object sender, EventArgs e)
{
for (int i = 0; i < MyCollection.Count; i++)
{
double Percent = i/MyCollection.Count * 100;
btn_ExpensiveProcess.Text = Percent + "% " + " Has Been Done";
}
}