惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
CXSECURITY Database RSS Feed - CXSecurity.com
Stack Overflow Blog
Stack Overflow Blog
月光博客
月光博客
T
Threat Research - Cisco Blogs
小众软件
小众软件
有赞技术团队
有赞技术团队
酷 壳 – CoolShell
酷 壳 – CoolShell
Apple Machine Learning Research
Apple Machine Learning Research
C
Cyber Attacks, Cyber Crime and Cyber Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
Tailwind CSS Blog
Cisco Talos Blog
Cisco Talos Blog
V
V2EX
博客园 - 【当耐特】
C
Cybersecurity and Infrastructure Security Agency CISA
Hugging Face - Blog
Hugging Face - Blog
The Cloudflare Blog
The Last Watchdog
The Last Watchdog
Simon Willison's Weblog
Simon Willison's Weblog
T
Threatpost
S
Secure Thoughts
O
OpenAI News
P
Proofpoint News Feed
S
SegmentFault 最新的问题
Forbes - Security
Forbes - Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Application and Cybersecurity Blog
Application and Cybersecurity Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Last Week in AI
Last Week in AI
宝玉的分享
宝玉的分享
Scott Helme
Scott Helme
T
Tenable Blog
A
Arctic Wolf
L
LINUX DO - 热门话题
爱范儿
爱范儿
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
www.infosecurity-magazine.com
www.infosecurity-magazine.com
V
Visual Studio Blog
Hacker News: Ask HN
Hacker News: Ask HN
Hacker News - Newest:
Hacker News - Newest: "LLM"
腾讯CDC
博客园 - Franky
WordPress大学
WordPress大学
Know Your Adversary
Know Your Adversary
博客园_首页
雷峰网
雷峰网
IT之家
IT之家
PCI Perspectives
PCI Perspectives
L
LINUX DO - 最新话题
H
Heimdal Security Blog

博客园 - Teracy

扫站:比较购物网站列表 MVC 2.0 学习笔记 和 Demo共享 网络书签的代码整理 2009年12月的工作发现 电子商务的认知 招聘Net软件工程师,网站设计师 sql2005数据库sa密码忘记了,该怎么办? 08年最后一天该说点什么了 邀请大家谈谈山寨版 工作小结 + 发布新的邮件发送工具 在ASP.NET中自动给URL地址加上超链接 把搜索引擎营销变成你的企业营销绩效飞跃重要策略 Google搜索引擎排名技巧 ASP.NET2.0实现无刷新客户端回调(热点技术) 工作记录 上班时间也要忙里偷闲 项目小结+Repeater中如何使用单选按钮 招聘Net软件工程师,测试工程师: 招聘ASP.NET技术人员
在ASP.NET中显示进度条-ASP.NET
Teracy · 2008-12-07 · via 博客园 - Teracy

对于加载时间比较长的ASP.NET页面,我们可以在客户端浏览器中显示进度条来显示页面正在装载。下面就是具体的实现过程:
  
  1.新建项目,名字为WebPortal,在项目类型中选择Visual C#项目或者Visual Basic项目都可;
  2.在模板类型中选择ASP.NET Web应用程序;
  3.位置里输入:http://localhost/WebPortal;
  4.添加新项:名字为ShowProgress的Web窗体。
  5.在您的Web窗体ShowProgress.aspx上添加任何其他的Web服务器控件。
  6.在ShowProgress.aspx上单击右键,点“查看代码”,在最上面输入:
  Visual C# .NET代码
  using System.Threading;
  
  Visual Basic .NET代码
  Imports System.Threading
  
  7.在Page_Load事件里输入: Visual C# .NET代码
  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);
  
  Visual Basic .NET代码
  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)
  
  8.在ShowProgress.aspx窗体的html的中输入:
  <script>
  HideWait();
  </script>
  
  9.点在浏览器中查看即可。

本文转自 天涯技术网: www.yy0808.com ,更多详细的技术文章,大家也可以访问我的技术网.希望 www.yy0808.com 能为我们的技术人员带来帮助.