I am working on a progress bar to update the user experience when we request data from the server. I have a Bootstrap progress bar that is updated it from JavaScript. I want pass the progress of the bar by passing the value from C# code. Here is what I have so far:
This is the HTML file:
<div class="progress">
<asp:HiddenField ID="hdnfldVariable" runat="server" />
<div class="progress-bar" role="progressbar" style="width: 0;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
</div>
This is the JavaScript File:
//Progress Bar
var progressBar = $('.progress-bar');
var progressNumber = "Here will go value from C# file";
setInterval(function () {
progressBar.css('width', progressNumber + '%');
progressBar.attr('aria-valuenow', progressNumber);
}, 100)
This is the C# value that I want to pass:
public int progressBarPercentage;
//listPrices.Count is List that updates when we request information from the server
progressBarPercentage = listPrices.Count;
I try to use "<%=progressBarPercentage%>" but is not working, there is any other approach to this. Thank you