<script language="javascript" type="text/javascript">
var
size = 2;
var id
= 0;
function
ProgressBar() {
document.getElementById("divProgress").style.display = "block";
document.getElementById("divUpload").style.display = "block";
id = setInterval("progress()", 20);
return
true;
}
function
progress() {
size = size + 1;
if
(size > 299) {
clearTimeout(id);
}
document.getElementById("divProgress").style.width = size + "pt";
document.getElementById("<%=lblPercentage.ClientID
%>").firstChild.data
= parseInt(size / 3) + "%";
}
</script>
<asp:Button ID="btnAddImage" runat="server" Text="Upload File"OnClientClick="return ProgressBar()" OnClick="btnAddImage_Click" />
<div id="divUpload"
style="display: none">
<div style="width: 300pt; text-align: center;">
Uploading...</div>
<div style="width: 300pt; height: 20px; border: solid 1pt gray">
<div id="divProgress"
runat="server"
style="width: 1pt; height: 20px; background-color: Blue;
display: none">
</div>
</div>
</div>
No comments:
Post a Comment