返回首页
当前位置: 主页 > 网络编程 > .Net实例教程 >

利用ASP.Net显示进度条代码

时间:2011-05-24 12:28来源:知行网www.zhixing123.cn 编辑:麦田守望者

技术实现:

protected void Page_Load(object sender, EventArgs e)

{

Response.Write("<div id='mydiv'>");

  Response.Write("_");

  Response.Write("</div>");

  Response.Write("<script>mydiv.innerText = '';</script>");

  Response.Write("<script language=javascript>;");

  Response.Write("var dots = 0;var dotmax = 10;function ShowWait()");

  Response.Write("{var output; output = '正在装载页面';dots++;if(dots>=dotmax)dots=1;");

  Response.Write("for(var x = 0;x < dots;x++){output += '·';}mydiv.innerText = output;}");

  Response.Write("function StartShowWait(){mydiv.style.visibility = 'visible'; ");

  Response.Write("window.setInterval('ShowWait()',1000);}");

  Response.Write("function HideWait(){mydiv.style.visibility = 'hidden';");

  Response.Write("window.clearInterval();}");

  Response.Write("StartShowWait();</script>");

  Response.Flush();

  Thread.Sleep(10000);

}

 

Js客户端:

<script>

  HideWait();

  </script>

顶一下
(1)
100%
踩一下
(0)
0%
标签(Tag):ASP.NET
------分隔线----------------------------
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
验证码:点击我更换图片