The example of this article describes the method of realizing Ajax two-level linkage with Jquery+json. Share to everyone for your reference, specific as follows:
Backstage 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;
}}}
Front desk dropdownlist.html
<!
DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd" >
I hope this article will help you with your jquery programming.