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

187
Views
¿Cómo pasar valores de C# a JavaScript usando MVC?

Estoy trabajando en una barra de progreso para actualizar la experiencia del usuario cuando solicitamos datos del servidor. Tengo una barra de progreso de Bootstrap que se actualiza desde JavaScript. Quiero pasar el progreso de la barra pasando el valor del código C#. Esto es lo que tengo hasta ahora:

Este es el archivo HTML:

 <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>

Este es el archivo JavaScript:

 //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)

Este es el valor de C# que quiero pasar:

 public int progressBarPercentage; //listPrices.Count is List that updates when we request information from the server progressBarPercentage = listPrices.Count;

Trato de usar "<%=progressBarPercentage%>" pero no funciona, hay otro enfoque para esto. Gracias

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!