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

210
Views
Mvc core hide loader on form submit end

I have an action that returns a file

return File(stream.ToArray(), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", fileName);

I managed to show the loader on form submit, using javascript

This is my view:


  <form method="post" asp-action="Action" asp-controller="Controller" Area="Area" enctype="multipart/form-data">
     <div class="panel-container show">
         <input type="submit" id="btnUpload" class="col-md-4" />
     </div>
     <div class="spinner-border mx-2" id="loader" role="status">
         <span class="sr-only">Loading...</span>
     </div>     
  </form>

This is the code I added in the JS to make the loading animation start, and it works:

$('#loader').hide();
$(function() {
   $('form').submit(function(){
       $('#loader').show();
   });
});

Now how do I hide it when the action is done doing its deed? Is there any way to do it without using AJAX?

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!