title: ASP.NET and C#: hide spinning wheel when button has finished processing
body: <p>In my web form, I have a button, and when users click on it, I show a spinning wheel to signal that the request is being processed:</p>
  
  <pre><code>&lt;td class="auto-style1"&gt;&lt;asp:LinkButton ID="lblButton" runat="server" OnClick="doSomething"&gt;Button&lt;/asp:LinkButton&gt;&lt;/td&gt; 
  &lt;td id="load" style="display:none"&gt; &lt;img src="Images/usethiswheel.gif" height="30" width="30" /&gt; &lt;/td&gt;
  </code></pre>
  
  <p>To regulate the appearance of the spinning wheel, I am using the following snippet:</p>
  
  <pre><code>&lt;script&gt;
  $(document).ready(function () {
    $('#lblButton').click(function () {
      $('#load').show();
      setTimeout(function () { $('#load').hide() }, 40000);
    });
   });
  &lt;/script&gt;
  </code></pre>
  
  <p>However, I am using a timeout function expiring after 40 seconds. How can I make the spinning wheel disappear in the exact moment the button has finished processing?</p>