标签:
效果:
html代码:
<input id ="comb" name ="comb"/>
JS代码:
$(function () { $(‘#comb‘).combobox({ width: 100, valueField: ‘id‘, textField: ‘name‘, url:‘../Json/comboBoxjson.ashx‘, }); })
后台一般处理程序代码:
public void ProcessRequest(HttpContext context) { DataTable dt = SQLHelper.ExecuteTable("select id, name from Tb_person", CommandType.Text); string comboboxjson = DatatableToJson.ToJson(dt); context.Response.Write(comboboxjson); }
标签:
原文地址:http://www.cnblogs.com/KTblog/p/4939074.html