Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

463
Views
How to calcualte await method time and shows PROGRESS BAR

I am uploading a file to Azure when the user clicks on the confirm dialog box. The content can be imagery, videos, or Excel and other file types.

It takes time while upload so during this time I want to show a progress bar. After successfully uploading I want to hide the progress bar. Can you please help me with it?

<div class="progress">
  <div id="progress" class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100" style="width: 0%;">
    <div id="label" class="control-label">0%</div>
  </div>
</div>
document.getElementById("dialogBtn").onclick = function() {
  ej.popups.DialogUtility.confirm({
    title: ' Confirmation Dialog',
    content: "Are you sure you want to upload images into Azure and Update DB",
    okButton: {
      text: 'OK',
      click: function() {
        okClickInsert();
        this.hide();
      }
    },
    cancelButton: {
      text: 'Cancel',
      click: ClickTest
    },
    showCloseIcon: true,
    closeOnEscape: true,
    animationSettings: {
      effect: 'Zoom'
    }
  });
};

function okClickInsert() {
  // Other Code

  $.ajax({
    url: "@Url.Action("UploadFilesinAzure", "UploadFiles")",
    data: JSON.stringify(UPLOADToAzure),
    type: "POST",
    dataType: "json",
    contentType: "application/json; charset=utf-8",
    beforeSend: onProgress,
    complete: onComplete,
    success: function(data) {
      location.reload();
    },
    error: function(data) {}
  });
}

function onProgress(args) {
  document.querySelector("body").style.visibility = "hidden";
  document.querySelector("#progress").style.visibility = "visible";
}

function onComplete(args) {
  document.querySelector("#progress").style.display = "none";
  document.querySelector("body").style.visibility = "visible";
};
[HttpPost]
public async Task<bool> UploadFilesinAzure([Frombody]...) {
  // Other validation  code
  await DoUploadFileOnlyAsync(FILE Details);
}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!