title: Asp.Net MVC 3 JSON Model Binding not working
body: <p>I am using MVC3 and that i know MVC3 support binding JSON literal to Action parameter. But i can't do it successfully;</p>
  
  <p>I have a class name Tag</p>
  
  <pre><code>public class Tag
  {
      public int tagId { get; set; }
      public string tagName { get; set; }
  }
  </code></pre>
  
  <p>An Action on controller called Tag</p>
  
  <pre><code>    [HttpPost]
      public ActionResult Tag(Tag tag)
      {
          // Here will be codes...
          return Json(new { success = 0 });
      }
  </code></pre>
  
  <p>Javascript code that send js object as JSON to my action</p>
  
  <pre><code>    var tag ={tagId:5,tagName:"hello"};
      $.ajax({
             url: "/image/tag",
             type: "POST",
             data: $.toJSON(tag),
             success: function (r) {
                 if (r.success == 1) {
                     window.location = r.redirect;
                 }
             }
  </code></pre>
  
  <p>Post Data that I see in Firebug Net tab</p>
  
  <pre><code>{"tagId":5,"tagName":"hello"}
  </code></pre>
  
  <p>Parameter name tag in Tag Action is not null but has values O for tagId and null for tagName.
  What the problem in here?</p>