In addition to { get; set; }
, these are some of the conditions for JSON Binding Support:
- This is new feature in ASP.NET MVC 3 (See “JavaScript and AJAX Improvements“).
- The JSON object’s strings (‘X’, ‘Y’, ‘Str’, and ‘Enabled’) must match ViewModel object’s properties.
- ViewModel object’s properties must have
{ get; set; }
method. - Must specify Content Type as “application/json” in the request.
- If it’s still not working, check the JSON string to make sure it’s valid one.
Read more at my post.
Hope that helps!