I'm defining an object like:
data = {
first: { Id: 1, Name: "This is my first name." },
second: { Id: 2, Name: "The second one." }
};
Then I'm trying to issue an Ajax request using:
$.ajax({
url: "/SomeURL"
type: "POST",
data: data,
success: function(){ ... },
error: function(){ ... }
});
But my data gets converted into an array like structure that Asp.net MVC default model binder isn't able to grasp.
first[Id]=1&first[Name]=...
What should I set or do, so jQuery will correctly convert these into:
first.Id=1&first.Name=...