首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

ashx+jquery+autocomplete.js怎么实现自动填充

2012-11-26 
ashx+jquery+autocomplete.js如何实现自动填充public void ProcessRequest(HttpContext context){context.

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;            }  


热点排行
Bad Request.