jquery.ui.autocomplete.js搜索自动完成功能






">
代理页面frmHouseData.aspx源码如下:

private void Page_Load(object sender, System.EventArgs e)
{
	if(!IsPostBack)
	{
		this.Response.Write(GetDataList());
		this.Response.End();
	}
}

protected string GetEstateList()
{
	string JsonStr=string.Empty;
	string EstName=this.Server.UrlDecode(this.Request.QueryString["RsName"]);
	string SqlStr = "select EstateName from t_Estate where charindex('"+EstName+"',EstateName)>0";
	SqlDataReader myDR = this.DataManager.selectReader(SqlStr);
	while (myDR.Read())
	{
	    JsonStr +=  "\""+myDR["EstateName"].ToString().Replace("\r","").Replace("\n","")+"\",";
	}
	if(RsName!=string.Empty)
	{
	    JsonStr=JsonStr.Remove(RsName.Length-1,1);
	}
	myDR.Close();		
	return "["+JsonStr+"]";
			
}
 
   

你可能感兴趣的:(Web前端)