This article mainly introduces jQuery + JSON to implement AJAX second-level interaction. It analyzes the front-end jQuery in combination with ajax to transmit json format data and background data processing techniques in the form of examples, which has some reference value, for more information about how to implement AJAX second-level interaction using jQuery + JSON, see the following example. We will share this with you for your reference. The details are as follows:
Background Handler. ashx
<%@ WebHandler Language="C#" Class="Handler" %>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; } }}
Frontend dropdownlist.html
Dropdowngrading