Hi,
I am trying to learn how to pass a JavaScript object to a server side class
and have been successful when it is a simple JavaScript object.
Suppose I have this Person class:
public class Person
{
public string FirstName { get; set; }
public string LastName { get; set; }
public string Address { get; set; }
public string City { get; set; }
public string Zip { get; set; }
}
And this web service method:
[WebMethod]
public void AddPerson(Person NewPerson)
{
NewPerson.Add();
}
On the client I can create a JavaScript object like the one below and then pass it to the server. On the server side the Person class will have all properties populated by the values in the JavaScript object.
"{"NewPerson":{"FirstName":"Jon","LastName":"Doe","Address" ...
Go to the complete details ...