asp.net-mvc Ajax binding


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) {
    ...
}