asp.net-mvc Model binding Ajax binding

30% OFF - 9th Anniversary discount on Entity Framework Extensions until December 15 with code: ZZZANNIVERSARY9

Example

These are form values that go in the HTTP request using the POST method. (including jQuery POST requests).

Say you did an ajax post like

$.ajax({
    type: 'POST',
    url: window.updatePost,
    data:  { id: 21, title: 'snappy title' },
    //kept short for clarity
});

Here the two values in json, id and title, would be bound to the matching action, e.g.

public JsonResult UpdatePost(int id, string title) {
    ...
}


Got any asp.net-mvc Question?