First the model:
and controller action:
Or using the new Razor view engine syntax: by the way working with razor is exciting.
I am sure this will get the message across, though the example is simplified. Now let us see the underpinnings of the function Employee.post(). This function wraps the jQuery ajax function inside, meaning you need to have a reference to jQuery in your view to get this up and running .The other heavy lifting is done by json2.js at line number 23, the call toJSON() converts the input array to json format making it easier for the jQuery $.ajax function. Since we are sending the data as json the content type for the ajax request should be application/json and this allows the MVC model binder and json value provider to reassemble the data and pass it on to the controller action.