title: Two requests in one time immediatly. ASP MVC + JQuery Ajax
body: <p>MVC application (ASP.NET MVC, client: jquery).</p>
  
  <p>Problem: The second ajax-request wait, when the first ajax request will done.</p>
  
  <p>I need, when the first and the second ajax-requests executes immediatly in one time.</p>
  
  <p>The page sends to server to determine the count of records (the first ajax-request), very long (~5-7 seconds).
  The operator click the buttom to open the card to edit it (the second ajax-request, fast, get the Dto-model).
  The user doesn't need to wait the first request, he wants to work immediatly.</p>
  
  <p>As a result, in Chrome in network page, two requests in status 'pending'. The second waits the first.</p>
  
  <p>Question, how can I send requests, to execute asynchronously ?</p>
  
  <p>The first ajax-request:</p>
  
  <pre><code>`window.jQuery`.ajax({
  type: 'POST',
  url: Url.Action("GetCountBooks", "Book");
  contentType: "application/json; charset=utf-8",          
  dataType: 'json',
  data: JSON.stringify({ typeBook: "...", filter: "..." };),
  success: function (data) {
      // show in UI page the count of books by filter and params
  },
  error: function (data) {
      //show error
  }});
  
  public class BookController : Controller
  {   
      [HttpPost]
      public NJsonResult GetCountBooks(string typeBook, Filter filter)
      {
          var data = DbProvider.GetCountBooks(typeBook, filter)
          if (data.Result == ResultType.Success)
          {
              var count = data.Data;
  
              return new NJsonResult
              {
                  Data = new { Data = count }
              };          
          }
  
          return new NJsonResult
          {
              Data = new { Error = "Error while counting the books." }
          };
      }
  }
  </code></pre>
  
  <p>The second ajax-request:</p>
  
  <pre><code>`window.jQuery`.ajax({
  type: 'POST',
  dataType: 'json',
  contentType: "application/json",
  url: Url.Action("GetBookById", "Book"),
  data: JSON.stringify({ id: bookId }),
  success: function (data) {
     // show jquery dialog form to edit dto-model.
  },
  error: function (data) {
     //show error
  }});
  
  public class BookController : Controller
  {   
      [HttpPost]
      public NJsonResult GetBookById(int id)
      {
          var data = DbProvider.GetBookById(id)
          if (data.Result == ResultType.Success)
          {
              var book = data.Data;               
              return new NJsonResult
              {
                  Data = new { Data = book }
              };
              return new NJsonResult
              {
                  Data = new { Error = "The book is not found." }
              };
          }    
          return new NJsonResult
          {
              Data = new { Error = "Error while getting the book." }
          };
      }
  }
  </code></pre>
  
  <p>I Cannot union ajax requests into one! The user can send various second request.</p>