ashx+jquery+autocomplete.js如何实现自动填充
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; if (context.Request.QueryString["q"] != null) { string key = context.Request.QueryString["q"]; string keyvalues = GetKeyValues(key); context.Response.Write(keyvalues); } } public string GetKeyValues(string k) { try { DataTable dt = BLL.GetDataTable("select KeyValue from wb_SearchKeyValue where KeyValue like '%"+k+"%'"); string result = ""; if (!CommonClass.DTRow.CheckDtIsEmpty(dt)) { StringBuilder items = new StringBuilder(); foreach (DataRow dr in dt.Rows) { items.Append(dr["KeyValue"].ToString() + "\n"); } result = items.ToString(); } return result; } catch (Exception ex) { AppLog.Write("关键字获取异常![SearchKeyValue.ashx异常信息:" + ex.Message + "]", AppLog.LogMessageType.Info); return string.Empty; }