創建進度條 <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 (milli
seconds)
var progressAt = progressEnd;
var progressTimer;
function progress_clear() {
for (var i =
; i <= progressEnd; i++) document
getElementById(
progress
+i)
style
backgroundColor =
transparent
;
progressAt =
;
}
function progress_update() {
progressAt++;
if (progressAt > progressEnd) progress_clear();
else document
getElementById(
progress
+progressAt)
style
backgroundColor = 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 System
Object
ByVal e As System
EventArgs) Handles MyBase
Load
在此處放置初始化頁的用戶代碼
If Not IsPostBack The
but_find
Attributes
Add(
onClick
Lay
style
visibility=
;progress_update();
)
End If
End Sub
注冊javascript腳本 Public Sub scriptjdt(ByVal objPage As System
Web
UI
Page
ByVal strValue As String)
Dim jb As String
jb =
<script language=
JavaScript
>
+ strValue +
</script>
objPage
RegisterStartupScript(
jdt_ok
jb)
End Sub
在查詢按鈕單擊事件中調用 Private Sub but_find_Click(ByVal sender As System
Object
ByVal e As System
EventArgs) Handles but_find
Click
查詢數據代碼
Me
scriptjdt(Me
Lay
style
visibility=
hidden
;progress_stop();
)
關閉進度條代碼
End Sub
From:http://tw.wingwit.com/Article/program/net/201311/12167.html