//网页加载进度显示 代码
//添加 引用 命名空间 using System.Threading;
//
//
Response.Write("<div style='COLOR: red; POSITION: absolute; ' 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.st
C# 加载web页面时显示进度条的js实例方法
最新推荐文章于 2023-05-28 11:40:37 发布
本文提供了一种在C# Web应用程序中显示网页加载进度的方法。通过在服务器端输出JavaScript代码,创建一个可见的进度条。利用`Response.Write`输出HTML和JS代码,设置一个定时器来动态更新进度,当页面内容如TreeView控件加载完成后,通过JavaScript隐藏进度条。
摘要由CSDN通过智能技术生成