title: How to show/hide progressbar for PageMethods?
body: <p>I am developing a web application using asp.net framework 4.0. I am using so many PageMethods in my application i.e my application is fully ajax enabled. I am not using UpdatePanel to avoid page partial postback. In my scenario i want to show progressbar when an AJAX request is made by PageMethods. I cant use UpdateProgress as It is associated with UpdatePanel which i am not using. I can show progress bar before calling a function &amp; onsuccess i can hide it. like</p>
  
  <pre><code>function CallPageMethod()
  {
     $("#progressDiv").show();
     PageMethods.GetCurrentDate(Onsuccess);
  }
  
  function Onsuccess(result)
  {
        $("#progressDiv").hide();
        alert(result);
  }
  </code></pre>
  
  <p>This methods works fine but its very difficult for me to write show &amp; hide code for each &amp; every pagemethods. As my page contains so many PageMethods. How do i write a common method which will show/hide progressbar for each AJAX request?</p>