Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

457
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda