一、AjaxSample.aspx 处理业务数据,产生XML数据,供JqueryRequest.aspx调用,代码如下:
protected void Page_Load(object sender, EventArgs e)
{
string uid = Request.QueryString["username"];
string pwd = Request.QueryString["password"];
Response.ContentType = "application/xml";
Response.Charset = "utf-8";
Response.Write("");
Response.Write(@"");
Response.Write(@"");
Response.Write(@"上海市 徐汇区");
Response.Write(@"");
Response.Write(@"");
Response.End();
}
二、JqueryRequest.aspx 通过点击按钮来请求AjaxSample.aspx,获取XMl数据。代码如下: