title: ajax call to Controller Action with an Object as parameter
body: <p>I have an <code>ajax</code> call to a Controller on an <code>ASP.NET</code> <code>MVC</code> solution that looks like this:</p>
  
  <pre><code>$.ajax({
          url: "ControllerClass/ControllerMethod?date=" + date,
          type: "POST",
          dataType: 'json',
          contentType: 'application/json; charset=utf-8',
          success: function (result) {
              globalVariable = result; // This is for later...
              DoSomething(result);
          },
          async: true,
          processData: false
      })
  </code></pre>
  
  <p>The controller once it has done all the work on the server side, it returns an Object which contains different property types (an Int, an Array of Int and a List of Objects)</p>
  
  <p>The way that I return that data from the controller back to the JS file is...</p>
  
  <pre><code>return Json(new
  {
     summary = objectResult
  });
  </code></pre>
  
  <p>The point is that from the JavaScript, now I would like to call a different Controller with the information that I have stored on my globalVariable which is defined in my JavaScript like this:</p>
  
  <pre><code>var globalVariable
  </code></pre>
  
  <p>That var located at the top of my JS file...</p>
  
  <p>Well, the way I am trying to call back my controller with that variable looks like this:</p>
  
  <pre><code>$.ajax({
                  url: "ControllerClass/ControllerMethod?result=" + globalVariable,
                  type: "POST",
                  dataType: 'json',
                  contentType: 'application/json; charset=utf-8',
                  success: function (result) {
                      DoSomethingNewWithThisresult(result)
                  },
                  async: true,
                  processData: false
              })
  </code></pre>
  
  <p>And this is my controller in C#.</p>
  
  <pre><code>public IActionResult ControllerMethod(JsonResult result)
  {
       DoSomethingHereWithTheResult(result);       
  }
  </code></pre>
  
  <p>Why if I put a breakpoing on my last controller, the result variable is empty? I checked on Chrome that the variable contains all the data that I am looking for. Actually, if I just pass one of the properties of the object, it goes to the controller just fine but I can't pass the whole Object...</p>