摘要: 1.新建demo.aspx页面。 2.首先在该页面的后台文件demos.aspx.cs中添加引用。 using System.Web.Services; 3.无参数的方法调用.大家注意了,这个版本不能低于.net framework 2.0。2.0已下不支持的。 后台代码: [WebMethod] public static string SayHello() { return "Hello Ajax!"; }JS代码: $(function() { $("#btnOK").click(function() { $.ajax({ //要用post方式 t 阅读全文
posted @ 2013-05-23 14:03 java程序员填空 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 在Web服务里代码/// <summary> /// WebService1 的摘要说明 /// </summary> [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消对下行的注释。 [System.Web.Scri 阅读全文
posted @ 2013-05-23 13:57 java程序员填空 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 完整的HTML结构<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title></title></head><body></body></htm 阅读全文
posted @ 2013-05-23 13:55 java程序员填空 阅读(135) 评论(0) 推荐(0) 编辑