title: MVC 3 - JSON serializer
body: <p>I have the following model, view and controller. </p>
  
  <p><strong>Model</strong></p>
  
  <pre><code> public class Person {
          public string Name;// { get; set; }
          public string Occupation { get; set; }
          public int Salary { get; set; }
          public int[] NumArr { get; set; }
      }
  </code></pre>
  
  <p><strong>View</strong></p>
  
  <pre><code>&lt;input type="button" id="Test" value="Test" /&gt;
  
  @section Javascript{
  &lt;script type="text/javascript"&gt;
      $(function () {
          $("#Test").click(function () {
              var data = { Name: "Michael Tom", Occupation: "Programmer", Salary: 8500, NumArr: [2,6,4,9] };
              var url = "Home/GetJson";
              $.ajax({
                  url: url,                
                  dataType: "json",
                  type: "POST",
                  data: data,
                  traditional: true,
                  success: function (result) {
  
                  }
              });
  
          });
      });        
  &lt;/script&gt;
  }
  </code></pre>
  
  <p><strong>Controller</strong> </p>
  
  <pre><code>public class HomeController : Controller
      {
          public ActionResult Index()
          {
              return View();
          }
  
          public JsonResult GetJson(Person person) {            
  
              return Json(......);
          }
      }
  </code></pre>
  
  <p>Based on those code above, I like to ask three questions. </p>
  
  <ol>
  <li><p>If we use public field instead of properties, the serializer doesn't serialize the json object to C# model so I always get null for "Name" field in controller. Why does it happen like that?</p></li>
  <li><p>If I changed the type of NumArr property to List then it doesn't work. How can we use List instead of the int[]? I know I'm passing the array from JS. Can we pass List from JS as well? </p></li>
  <li><p>I'm using "traditional: true" in Javascript code block of View because serialization doesn't work with "traditional: false". I heard that jQuery has three version of Json serializer. ASP.NET MVC's serializer supports only old version. Is it true?</p></li>
  </ol>
  
  <p>3.1. If it's true, I like to know when you are going to get the latest version of MVC's serializer that supports jQuery's latest version. </p>
  
  <p>3.2. Is there any way to register a custom Javascript Serializer just like we can register custom view engine? My friend suggested me that I can register custom value provider or custom model binder and use custom JS serializer in my custom value provider /model binder.</p>
  
  <p>Thanks in advance. Please feel free to let me know if you are not clear about my questions. Thanks!   </p>