0

I am using ASP.NET Core application. Lets say I have following form

<form asp-controller="Demo" asp-action="RegisterAddress" method="post">
    Email:  <input asp-for="Email" /> <br />
    Password: <input asp-for="Password" /><br />
    Address: <input asp-for="Address.AddressLine1" /><br />
    <button type="submit">Register</button>
</form>

I want to show busy indicator when user clicks submit button. I know how to do it using JQuery and Ajax. If i use jQuery's ajax method to POST data then i dont need asp-controller,asp-action attribute on the form. But i would like to have everything defined in HTML. Instead of having partial POST logic in javascript.

So is there anyway to show busy indicator WITHOUT using JQuery + Ajax?

LP13
  • 30,567
  • 53
  • 217
  • 400
  • No offense, but you have the weirdest requirements. In theory it may be possible to have a middleware on the action which sends/flushes a partial rendered HTML content to which shows a animated progress bar and once finished write/flush the rest of the html content which hides the progress bar, this seem way overkill and is magnitudes of more compilcated and harder to maintain than a few lines of javascript. That's what it was made for. It just doesn't justify the effort – Tseng Dec 14 '16 at 20:12
  • @Tseng This is not a requirement. The requirement is to show busy indicator. How we show it is upto developer. And im just curious to know if we can do it without using jquery :) – LP13 Dec 14 '16 at 20:20
  • So you just want it to show the spinner / indicator after post before the next page loads but don't want to post via ajax, correct? If so, see this related question: http://stackoverflow.com/questions/27026323/show-loading-gif-after-clicking-form-submit-using-jquery – stephen.vakil Dec 14 '16 at 20:40

0 Answers0