随笔分类 -  Ajax

摘要:WebService: using System.Web.Script.Services; [GenerateScriptType(typeof(people))] [WebMethod] public List<people> GetPeopleList() { List<people> list = new List<people>(); for (int ... 阅读全文
posted @ 2009-05-05 15:11 Localhost 阅读(4182) 评论(0) 推荐(1)
摘要:Ajax通过序列化是可以返回DataTable的,此处没有进行任何处理,所以会导致报错. WebService: [WebMethod] public DataTable GetDataTable(string tableName) { // 设定DataTable的名称 DataTable table = new DataTable(tableName); // 为该DataTable添加两列... 阅读全文
posted @ 2009-05-05 10:57 Localhost 阅读(1065) 评论(0) 推荐(0)
摘要:前: debugger后,和数组很像 自定义类:public class people{ private string name; public string Name { get { return name; } set { name = value; } } private string password; public string Password { get { return pass... 阅读全文
posted @ 2009-05-05 09:35 Localhost 阅读(2007) 评论(0) 推荐(0)
摘要:枚举:public enum WeekDay{ Sat, Sun, Mon, Tue, Wed, Thu, Fri}WebService: [WebMethod] public WeekDay GetWeekDay() { return WeekDay.Fri; }ScriptManager: <asp:ScriptManager ID="sm" runat="server"> <... 阅读全文
posted @ 2009-05-05 09:01 Localhost 阅读(670) 评论(0) 推荐(0)
摘要:PageMethods: using System.Web.Services; [WebMethod] public static string Ok() { return "this is function ok!"; }注意:using及WebMethodScriptManager: <asp:ScriptManager ID="sm" runat="server" EnablePage... 阅读全文
posted @ 2009-05-04 22:27 Localhost 阅读(551) 评论(0) 推荐(0)
摘要:自定义类:public class people{ private string name; public string Name { get { return name; } set { name = value; } } private string password; public string Password { get { return password; } set { passwo... 阅读全文
posted @ 2009-05-04 21:51 Localhost 阅读(1547) 评论(0) 推荐(0)
摘要:自定义类:public class people{ private string name; public string Name { get { return name; } set { name = value; } } private string password; public string Password { get { return password; } set { passwo... 阅读全文
posted @ 2009-05-04 15:42 Localhost 阅读(521) 评论(0) 推荐(0)
摘要:自定义类:public class people{ private string name; public string Name { get { return name; } set { name = value; } } private string password; public string Password { get { return password; } set { passwo... 阅读全文
posted @ 2009-05-04 15:24 Localhost 阅读(1030) 评论(0) 推荐(0)
摘要:WebService: [WebMethod] public string[] GetSimpleArray() { string[] cities = { "北京", "上海", "天津", "重庆" }; return cities; }ScriptManager: <asp:ScriptManager ID="sm" runat="server"> <Services>... 阅读全文
posted @ 2009-05-04 11:49 Localhost 阅读(2025) 评论(0) 推荐(0)