国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 學(xué)院 > 開(kāi)發(fā)設(shè)計(jì) > 正文

ASP.Net 上傳進(jìn)度條的實(shí)現(xiàn)方法

2019-11-17 01:37:07
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

asp.net 上傳進(jìn)度條的實(shí)現(xiàn)方法

對(duì)于加載時(shí)間比較長(zhǎng)的ASP.NET頁(yè)面,我們可以在客戶(hù)端瀏覽器中顯示進(jìn)度條來(lái)顯示頁(yè)面正在裝載。下面就是具體的實(shí)現(xiàn)過(guò)程:

新建項(xiàng)目,名字為WebPortal,在項(xiàng)目類(lèi)型中選擇Visual C#項(xiàng)目或者Visual Basic項(xiàng)目都可;在模板類(lèi)型中選擇ASP.NET Web應(yīng)用程序;位置里輸入:http://localhost/WebPortal;添加新項(xiàng):名字為ShowPRogress的Web窗體。在您的Web窗體ShowProgress.aspx上添加任何其他的Web服務(wù)器控件。在ShowProgress.aspx上單擊右鍵,點(diǎn)“查看代碼”,在最上面輸入:Visual C# .NET代碼

using System.Threading;Visual Basic .NET代碼 Imports System.Threading在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 = '正在裝載頁(yè)面';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 = '正在裝載頁(yè)面';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)在ShowProgress.aspx窗體的html的中輸入: <script> HideWait(); </script>

點(diǎn)在瀏覽器中查看即可


發(fā)表評(píng)論 共有條評(píng)論
用戶(hù)名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 临西县| 黔东| 犍为县| 平定县| 慈利县| 浠水县| 沐川县| 余江县| 太白县| 甘孜县| 承德县| 界首市| 杭锦旗| 宣城市| 萍乡市| 芦溪县| 镇雄县| 饶平县| 依安县| 新营市| 南昌市| 百色市| 黎川县| 和田县| 吴江市| 江陵县| 万州区| 绥滨县| 历史| 乡宁县| 昆山市| 临澧县| 松潘县| 济南市| 洛阳市| 霸州市| 湘阴县| 信阳市| 中方县| 施甸县| 岑溪市|