zoukankan      html  css  js  c++  java
  • 对长时间装载的ASP.NET页如何在客户端浏览器中显进度

    对于长时间装载的ASP.NET页面如何在客户端浏览器中显示进度?在Page_Load事件里添加正在装载提示。。。

    引入:using System.Threading;

    在Page_Load事件里输入:

    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 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(
    20000);

    在.aspx页输入

    &lt;script&gt;HideWait();&lt;/script&gt;
    转自:http://blog.sina.com.cn/s/blog_4efce4d10100cimv.html
  • 相关阅读:
    30天内自动登录
    本地保存cookie
    thymeleaf 基本表达式
    适配器(adapter)与fragment之间、fragment与activity之间的通信问题
    String/Stringbuilder/StringBuffer
    if else与switch for与foreach
    iOS App 签名的原理
    iOS category内部实现原理
    iOS中的事件的产生和传递
    RunLoop
  • 原文地址:https://www.cnblogs.com/bicabo/p/1438361.html
Copyright © 2011-2022 走看看