title: ASP.Net ScriptManager -> ServiceReference Ajax calls - Can I catch Start and End Events?
body: <p>I have a WCF service locally in my ASP.Net 4.0 application.  I have the following in my MasterPage:</p>
  
  <pre><code>&lt;asp:ScriptManager runat="server"&gt;
      &lt;Services&gt;
          &lt;asp:ServiceReference Path="~/Services/AJAXDataService.svc" /&gt;
      &lt;/Services&gt;
  &lt;/asp:ScriptManager&gt;
  </code></pre>
  
  <p>Then on my page I have the following JavaScript code:</p>
  
  <pre><code>...
  5 calls to the service to fill in drop downs and such
  ...
  
  $(document).ajaxStop(function () {
      var service = new BOR.AJAXDataService();
      service.GetComplaintDetails(passed, FillComplaint, DefaultFailure, null);
  }); // AjaxStop - Event - Everything is done, now load the Model
  </code></pre>
  
  <p>This happens in the Document Ready event after about 5 other ajax calls.  If I do NOT put this in the ajaxStop event, it works, but depending on database and network latency, it may not work because the <strong>GetComplaintDetails</strong> needs what comes back from each of the previous calls.</p>
  
  <p>I found the ajaxStop method and thought it is exactly what I need.  But apparently the Microsoft/ScriptManager calls do not go through jQuery (of course) so that function is pointless.</p>
  
  <p><strong>Q:</strong>  Is there a way to intercept the being/end, start/stop events of each of the previous calls when using the ScriptManager reference?  I would rather do this than creating the long and wordy jQuery calls.</p>