I have a long process and I want to show the user a progress bar in which I pass the parameter (percentage) to the Javascript function in my Webform with the main page.
I have it:
<script type="text/javascript">
function updateProgress(percentage) {
document.getElementById('ProgressBar').style.width = percentage+"%";
}
</script>
and
<div class="progress progress-striped active progress-success" style="height: 43px">
<div id="ProgressBar" class="progress-bar" role="progressbar" runat="server"
aria-valuemin="0" aria-valuemax="100" style="width: 0%">
</div>
</div>
In my code, I have this to pass a parameter to a function:
string updateProgress = "18";
ClientScript.RegisterStartupScript(this.GetType(), "updateProgress", "updateProgress('" + updateProgress + "');", true);
When I run the code, the progress indicator never moves from 0%. I would like to continue to update the percentage filling from the code until it reaches 100%, again calling the function with new parameters.
I was browsing the forums, but I don’t see what I need to get it to work.
Any ideas?
source
share