Your web method is accepting a list of Persons, but that is not what you are passing from the client. You are passing an object that contains a list of persons. If you want it to work, you should just pass the list itself and not wrap it in an object.
$.ajax({
type: "POST",
url: "TestPage.aspx/GetData",
data: '[{ "Name": "Me"}]',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function () {
alert("Data Submitted");
}
});
Another alternative, if you can't change the client, is to change the server side to expect the wrapper object.
Create a class to hold the list...
class PersonListWrapper
{
public List<Person> persons { get; set; }
}
...and change your web method to accept that class.
[WebMethod]
public static void GetData(PersonListWrapper wrapper)
{
foreach (Person p in wrapper.persons)
{
...
}
}