CeiWCJ 2010-03-16
代码如下:
[WebMethod] public Person GetPerson(string name, int age, string address) { Person p = new Person() { Name = name, Age = age, Address = address }; return p; }
代码如下:
public class Person { private string _name; public string Name { get { return _name; } set { _name = value; } } private int _age; public int Age { get { return _age; } set { _age = value; } } private string _address; public string Address { get { return _address; } set { _address = value; } } }
代码如下:
<script type="text/javascript" language="javascript"> function BtnPerson_Click() { $.ajax({ url: "WebService.asmx/GetPerson", data: { name: "Windy", age: 18, address: "Shanghai China" }, type: "post", success: function(data, status) { var obj = $(data); var name = obj.find("Name").text(); var age = obj.find("Age").text(); var address = obj.find("Address").text(); alert("Name:" + name + " Age:" + age + " Address:" + address); } }); } </script>
结束数据方法的参数,该如何定义?-- 集合为自定义实体类中的结合属性,有几个实体类,改变下标就行了。<input id="add" type="button" value="新增visitor&quo
本文实例讲述了php+ ajax 实现的写入数据库操作。分享给大家供大家参考,具体如下:。<input class="tel" type="text" placeholder="请输入您的手机号码&q