JS Code.
// this is person class constructor.
function personClass(id, name, address, phone) {
this.Id = id;
this.Name = name;
this.Address = address;
this.Phone = phone;
}
var person = new Array();
person.push(new personClass("101", $('#txtName').val(), $('#txtAddress').val(), $('#txtPhone').val());
AjaxRequest = function ("PersonInfo.asmx/AddNewPerson", "{'person[]':'" + JSON.stringify(person) + "'}", successcallback, errorcallback) {
$.ajax({
type: "POST",
url: url,
data: param,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: successcallback,
error: errorcallback
});
}
// this is person class constructor.