本文实例讲述了jquery json ajax 二级联动菜单。分享给码农们参考,具体如下:
后台handler.ashx
using system;using system.web;using system.data;public class handler : ihttphandler{ common coobj = new common(); public void processrequest(httpcontext context) { if (context.request.params[n] != null) { string num = context.request.params[n].tostring(); context.response.contenttype = text/plain; string str = select * from address where a_num2= + num; datatable dt = coobj.gettable(str); string json = jsonhelper.datatabletojson(dt); context.response.write(json); } } public bool isreusable { get { return false; } }}
前台dropdownlist.html
dropdownlit
jquery json ajax 二级联动菜单实例,需要的码农拿去参考。