How would you pass objects with MVC and jQuery AJAX?

Posted by Ken on Stack Overflow See other posts from Stack Overflow or by Ken
Published on 2010-04-27T17:25:11Z Indexed on 2010/04/27 17:33 UTC
Read the original article Hit count: 505

I am finally experimenting and trying to learn MVC after years of asp.net.
I am used to using asp.net AJAX PageMethods where you can pass an object that automagically gets parsed to whatever type the parameter is in that method.

Javascript:

PageMethods.AddPerson({First:"John",Last:"Doe"});

Code-Behind:

[WebMethod]
public static Result AddPerson(Person objPerson)
{
    return Person.Save();
}

How would do this using MVC and jQuery?
Did just have to send strings and parse the json to object?

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about AJAX