How to put the figure 1 a drop-down box to select the value of the query in figure 2 to
CodePudding user response:
Refer to the https://www.cnblogs.com/lcl_1015/articles/1865823.html
CodePudding user response:
Front end and values:
Js:
$(" # test2 "). Click (function () {
$. Ajax ({
Type: "post",
Url: "Handler. Ashx,"
Data: {m: 'a'},
Success: the function (result) {
$(" # testText "). Append (result + "& lt; Br/& gt;" );
}
});
});
Handle receiving:
[System. Web. Script. Services. ScriptService]
Public class BaseService: AHttpHandler
{
Public override void the ProcessRequest (string method)
{
The switch (method)
{
Case "DocInfo" :
GetDocInfo (context);
break;
Default:
break;
}
}
Public virtual void GetDocInfo (HttpContext contex)
{
Try
{
String dir=context. Request. Params [" dir "]==null? "" : context. Request. Params [r]." dir "ToString ();
String strJson=Newtonsoft. Json. JsonConvert. SerializeObject (di);
Contex. Response. Write (strJson);
}
}
The catch (Exception ex)
{
Logger. The Log. The Error (SPContext. Current. Web. CurrentUser. LoginName and ex);
}
}
}
CodePudding user response: