This topic has been archived. It cannot be replied.
-
工作学习 / 专业技术讨论 / 求助ASP.NET一个问题.在ASP.NET PAGE 里 拖放两个WEB FORM 控件,其中一个是BUTTON 里边有一段代码,另外一个是LABLE 控件.
现在想在运行BUTTON 代码的时候,其执行的进度能显示在LABLEL 上,不知道能不能实现.
-bobo123(bobo);
2005-7-5
{174}
(#2381497@0)
-
能
-henhen(亨亨,明天会更好 *_*);
2005-7-5
(#2381504@0)
-
怎么实现?谢谢.
-bobo123(bobo);
2005-7-5
(#2381579@0)
-
我也想知道.
-weiweiwoo(summer);
2005-7-5
(#2381635@0)
-
it depends what kind of operation is in the button.
if it's a loop, you just change the progress in the loop to set text on the lable.if it's no, maybe several several operations, you have to set the progress among each operation.
-toronto_fun(BeMyself);
2005-7-7
{97}
(#2385527@0)
-
不行.底下是测试代码private void Button1_Click(object sender, System.EventArgs e)
{
long i=0;
long k=0;
Label2.Text="10%";
k=0;
for(i=0;i<100000000;i++)
k++;
Label2.Text="20%";
k=0;
for(i=0;i<100000000;i++)
k++;
Label2.Text="30%";
k=0;
for(i=0;i<100000000;i++)
k++;
Label2.Text="40%";
k=0;
for(i=0;i<100000000;i++)
k++;
}
}
-bobo123(bobo);
2005-7-7
{405}
(#2385744@0)
-
这些都是在server端执行的, 页面怎么会有变化.
-weiweiwoo(summer);
2005-7-7
(#2385754@0)
-
这样不行的,看你的PM。
-henhen(亨亨,明天会更好 *_*);
2005-7-7
(#2385761@0)
-
pm to me too. pls
-weiweiwoo(summer);
2005-7-7
(#2386088@0)
-
为什么一定要PM,何必这么保守呢。我想用HttpResponse.Flush应该可以做吧,不过要等整个页面都显出来,再改其中一块的内容好像也不容易。还要结合DHTML吧。
-holdon(again);
2005-7-8
(#2387986@0)
-
创建另一个xxx.aspx,button要执行的代码放到新页的onload事件中,button用server.excute( xxx.aspx )xxx.aspx - onload中可以放response.write 在页面上输出, 这样只能一行一行的输出,如果你response.write( "<script language=javascript>document.statusLabel.innerHTML='xxxxxx';</script>"...)就可以做到了。
-dzhu(Dan);
2005-7-22
{202}
(#2412992@0)
-
let page refresh every 3 seconds, and read the progress from back end.
I did it before in www.iLinkTech.ca
-flowriver(iLinkTech.ca);
2005-7-22
(#2413262@0)