熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> .NET編程 >> 正文

一個ASP.NET的進度條

2013-11-13 09:58:36  來源: .NET編程 

  創建進度條
  
  <DIV id=Lay ><FONT face=宋體></FONT><FONT face=宋體></FONT><FONT face=宋體></FONT><FONT face=宋體></FONT><br>
  <b><font color=# size=>      & nbsp;          正在檢索數據請稍候</font></b>
  <table align=center>
  <tr>
  <td>
  <div ><span id=progress> </span>
  <span id=progress> </span> <span id=progress> </span> <span id=progress>
   </span> <span id=progress> </span> <span id=progress> </span>
  <span id=progress> </span> <span id=progress> </span> <span id=progress>
   </span> <span id=progress> </span> <span id=progress> </span>
  <span id=progress> </span> <span id=progress> </span><span id=progress> </span><span id=progress> </span>
  </div>
  </td>
  </tr>
  </table>
  <script language=javascript>
  var progressEnd = ; // set to number of progress <span>s
  var progressColor = blue; // set to progress bar color
  var progressInterval = ; // set to time between updates (milliseconds)
  
  var progressAt = progressEnd;
  var progressTimer;
  function progress_clear() {
  for (var i = ; i <= progressEnd; i++) documentgetElementById(progress+i)stylebackgroundColor = transparent;
  progressAt = ;
  }
  function progress_update() {
  progressAt++;
  if (progressAt > progressEnd) progress_clear();
  else documentgetElementById(progress+progressAt)stylebackgroundColor = progressColor;
  progressTimer = setTimeout(progress_update()progressInterval);
  }
  function progress_stop() {
  clearTimeout(progressTimer);
  progress_clear();
  }
  //progress_update(); // start progress bar
  </script>
  </DIV>
  
  設置查詢按鈕屬性
  
  Private Sub Page_Load(ByVal sender As SystemObject ByVal e As SystemEventArgs) Handles MyBaseLoad
  在此處放置初始化頁的用戶代碼
  If Not IsPostBack The
  but_findAttributesAdd(onClick Laystylevisibility=;progress_update();)
  End If
  End Sub
  
  注冊javascript腳本
  
  Public Sub scriptjdt(ByVal objPage As SystemWebUIPage ByVal strValue As String)
  Dim jb As String
  jb = <script language=JavaScript> + strValue + </script>
  objPageRegisterStartupScript(jdt_ok jb)
  End Sub
  
  在查詢按鈕單擊事件中調用
  
  Private Sub but_find_Click(ByVal sender As SystemObject ByVal e As SystemEventArgs) Handles but_findClick
  查詢數據代碼
  
  
  Mescriptjdt(Me Laystylevisibility=hidden;progress_stop();) 關閉進度條代碼
  End Sub
From:http://tw.wingwit.com/Article/program/net/201311/12167.html
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.