Basically things are supported quite a bit out of the box. I don't register any of the Phil Haack's things, and things work without a problem. Default model binder is able to consume data passed to the server. Getting JSON strings on the server is a no-brainer only when you have a client side (or other server side service) that you can't really control. Phil Haack explains it very well in this blog post comment.
Server-side part
Consider this server side application model:
public class Person
{
[Required]
public string FirstName { get; set; }
[Required]
public string LastName { get; set; }
[Required]
[Range(0, 100)]
public int Age { get; set; }
}
And consider this controller (People controller) action:
[HttpPost]
public ActionResult Add(Person data)
{
if (!this.ModelState.IsValid)
{
// do something about invalid data (check "Additional Info" below)
}
Person result = this.Service.Add(data);
return Json(result);
}
Client-side part
This action will be able to consume javascript objects like:
var person = {
FirstName: "John",
LastName: "Doe",
Age: 35
};
By using jQuery for instance it would be this way:
$.ajax({
url: "People/Add",
type: "POST",
data: person,
success: function(data, status, xhr) {
// process data
},
error: function(xhr, status, err) {
// process invalid results
}
});
This will not directly send JSON string to the server, but I wonder why would one bother to convert to JSON string and send that and then do additional processing on the server side, when you can use KISS principle and follow this route I've described here. It works out of the box even in MVC 1. You can pass through whatever you need. Lists, arrays, objects etc.
You've probably constructed your JSON string out of a real Javascript object/array. I'm suggesting you use this original object, you've constructed and pass it to $.ajax call.
Additional info
Handling model state errors isn't as trivial as one may think. Read my blog post to get some more information about it and one of the possible solutions to the problem.
Passing through lists or other collections may pose an additional challenge. Check a different blog post about it and you'll see how to properly do it.