国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 塔城市| 丽水市| 饶河县| 布拖县| 侯马市| 德州市| 娄底市| 达拉特旗| 平安县| 砀山县| 沅江市| 宿松县| 许昌县| 诏安县| 武强县| 景东| 台东市| 醴陵市| 乌兰察布市| 新蔡县| 东宁县| 昭苏县| 兴和县| 湖口县| 玉龙| 区。| 历史| 白城市| 双牌县| 津市市| 安化县| 厦门市| 潞城市| 武山县| 灵石县| 泸定县| 神木县| 漠河县| 白山市| 黄石市| 醴陵市|