Haacked/CodeHaacks — Issue #5: Model Binding Problem?
Author: tommck
Created: 2011-11-22 21:42:40+00:00
State: open

I have a FilterController with a "Filters" Action on it.
It takes a complex JSON object.

public class FilterController : JsonController
{
public JsonResult Filters(FilterData filters)
...

Calling it like this always results in a null value, almost like it is not running through Model Binding:

$mvc.Filter.Filters({ filters: currData })...

I can actually see the big blob of JSON data in the Request.InputStream

Calling it like this works fine:

$.ajax({
cache: false,
dataType: 'json',
type: 'POST',
data: window.JSON.stringify({ filters: currData }),
contentType: 'application/json; charset=utf-8',
url: '/Dev/Filter/Filters'
})

Is there something I'm doing wrong?