1. WebService. asmx:
Process business data and generate the person Entity Data in the getperson method for calling jqueryrequest. aspx, Code As follows:
Copy code The Code is as follows: [webmethod]
Public Person getperson (string name, int age, string address)
{
Person P = new person ()
{
Name = Name,
Age = age,
Address = address
};
Return P;
}
2. Person. CS entity class: copy Code the code is as follows: public class person
{< br> private string _ name;
Public string name
{< br> get {return _ name ;}< br> set {_ name = value ;}
}< br> private int _ age;
Public int age
{< br> get {return _ age ;}
set {_ age = value ;}< BR >}< br> private string _ address;
Public String address
{< br> get {return _ address ;}< br> set {_ address = value ;}
}< BR >}
3. ajaxrequest. aspx
click the button to request WebService. the getperson (string name, int age, string address) method of asmx obtains the object data of person. The Code is as follows: copy Code the code is as follows: