using System;
using System.Web;

namespace webDBADMIN.UserControls
{
    /// <summary>
    /// WebProgressBar Web页面使用的进度条。仅提供静态方法。
    /// </summary>
    public class WebProgressBar
    {
        private WebProgressBar()
        {
        }
        public static void Show()
        {
            HttpResponse Response = System.Web.HttpContext.Current.Response ;
            Response.Write("<div id='showtext' style='z-index:9999;position: absolute; left:0; top:300;font-size:12px'></div><div style='z-index:9999;position: absolute; left:0; top:320;' id='mydiv' style=\"BACKGROUND-COLOR:blue;width:0px\">");
            Response.Write("_");
            Response.Write("</div>");
            Response.Write("<script>mydiv.innerText = '';</script>");
            Response.Write("<script language=javascript>;");
            Response.Write("var dots = 0;var dotmax = 15;function ShowWait()");
            Response.Write("{var output; showtext.innerText = '正在装载页面';dots++;if(dots>=dotmax)dots=1;");
            Response.Write("mydiv.style.width = dots*40}");
            Response.Write("function StartShowWait(){mydiv.style.visibility = 'visible'; ");
            Response.Write("window.setInterval('ShowWait()',1000);}");
            Response.Write("function HideWait(){showtext.style.visibility = 'hidden';mydiv.style.visibility = 'hidden';");
            Response.Write("window.clearInterval();}");
            Response.Write("StartShowWait();</script>");
            Response.Flush();
        }
        public static void Hide()
        {
            HttpResponse Response = System.Web.HttpContext.Current.Response ;
            Response.Write("<script>HideWait();</script>");
            Response.Flush();
        }
    }
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-22
  • 2021-05-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-09
  • 2022-12-23
  • 2021-12-03
  • 2021-09-28
  • 2022-01-20
相关资源
相似解决方案