title: jQuery post array - ASP.Net MVC 4
body: <p>I have spent 8 hours or so today trying to figure this out. I have viewed lots of solutions but cannot get the same results. I have a hunch it has everything to do with being relatively new to ASP.Net. </p>
  
  <p>Here is the latest question I tried mimicking with no luck.
  <a href="https://stackoverflow.com/questions/10007722/post-array-as-json-to-mvc-controller#_=_">https://stackoverflow.com/questions/10007722/post-array-as-json-to-mvc-controller#<em>=</em></a></p>
  
  <p><a href="https://stackoverflow.com/questions/320291/how-to-post-an-array-of-complex-objects-with-json-jquery-to-asp-net-mvc-control">How to post an array of complex objects with JSON, jQuery to ASP.NET MVC Controller?</a></p>
  
  <p>Basic Rundown of Problem:
  I have an array of json objects I would like to pass to my controller. When I pass the data it shows lets say for example 3 items, but their values are not passed or it just shows nothing was passed. Firebug shows it passed it so I assume that something is not setup right and its not allowing it to set that variable up correctly on the C# side.</p>
  
  <p>I have tried a few things and ill list them below:
  Setup 1:
  I tried mocking what I seen at the second link:</p>
  
  <pre><code>$.ajax({
          type: 'Post',
          cache: false,
          url: '/Workflow/Home/UpdateStepPositions',
          data: { 'steps': ['1','2','3'] },
          async: false,
          success: function (data) {
              console.debug(data);
          },
          error: function (data) {
              console.debug(data);
          }
      });
  
   Controller
   [HttpPost]
      public ActionResult UpdateStepPositions(string[] steps){
  
          var bresults = new {
              Success = false,
              Message = "Unable to update step positions."
          };
  
          return Json(bresults);
      }
  </code></pre>
  
  <p>I couldn't even get that simple setup working.. It gets to the function and shows there was nothing passed....</p>
  
  <p>Setup 2:</p>
  
  <pre><code> list = new Array();
      list.push({ "step": 1, "position": 1 });
      list.push({ "step": 2, "position": 2 });
      list.push({ "step": 3, "position": 3 });
  
      $.ajax({
          type: 'Post',
          cache: false,
          url: '/Workflow/Home/UpdateStepPositions',
          data: JSON.stringify({ 'steps': list }),
          async: false,
          success: function (data) {
              console.debug(data);
          },
          error: function (data) {
              console.debug(data);
          }
      });
  
      Controller
     [HttpPost]
      public ActionResult UpdateStepPositions(List&lt;UpdatedSteps&gt; steps){
          var bresults = new {
              Success = false,
              Message = "Unable to update step positions."
          };
  
          return Json(bresults);
      }
  
     Class
     public class UpdatedSteps {
      public string Step { get; set; }
      public string Position { get; set; }
  }
  </code></pre>
  
  <p>Can anyone shine some light on what I'm missing or point me in the right direction? Hopefully its something simple and just a newbie mistake!</p>