1.Ajax.html
复制代码 代码如下:
AJAX
<select id="Select1" onchange="loadXMLDoc(this.value)">
select>
<select id="citys">
select>
2.getdata.aspx.cs
复制代码 代码如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class ajax_getdata : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string[] js=new string[]{"南京", "苏州", "常州" , "无锡" , "镇江"};
string pro=Request.QueryString["pro"];
if (pro == "1")
{
string temp = "";
for (int i = 0; i < js.Length; i++)
{
temp = temp + js[i];
temp = temp + ",";
}
Response.Write(temp);
}
else
Response.Write("");
}
}