首页 相关文章 Jquery Ajax学习实例3 向WebService发出请求调用方法返回数据

Jquery Ajax学习实例3 向WebService发出请求调用方法返回数据

一、WebService.asmx
  处理业务数据,在GetWhether方法中产生天气情况数据,供JqueryRequest.aspx调用,代码如下:

代码如下:


[System.Web.Script.Services.ScriptService]
public class WebService : System.Web.Services.WebService {
public WebService () {
//如果使用设计的组件,请取消注释以下行
//InitializeComponent();
}
[WebMethod]
public string GetWhether(string cityId)
{
Random r = new Random();
int degree = r.Next(100);
string wInfo = string.Format("Today {0}'s temperature is {1} degrees", cityId, degree);
return wInfo;
}
}
[ 查看全文 ]

2016-02-19 标签:

Jquery Ajax学习实例3 向WebService发出请求调用方法返回数据的相关文章

手机页面
收藏网站 回到头部