Ajax passes the implementation code of multiple parameters, while ajax passes multiple parameters
The examples in this article share the code for passing multiple parameters through ajax for your reference. The details are as follows:
<Html>
WebService1.asmx
Using System; using System. collections. generic; using System. linq; using System. web; using System. web. services; namespace ajax11 {// <summary> // summary of WebService1 /// </summary> [WebService (Namespace =" http://tempuri.org/ ")] [WebServiceBinding (ConformsTo = WsiProfiles. basicProfile1_1)] [System. componentModel. toolboxItem (false)] // to allow ASP. net ajax calls this Web service from the script. Please cancel the comments to the downstream. [System. web. script. services. scriptService] public class WebService1: System. web. services. webService {[WebMethod] public string HelloWorld () {return "Hello World";} [WebMethod] public string ValidateUser (string username) {if (username = "onlifes ") {return "the user name is in use. Please select another";} else {return "can be used. Please continue";} [WebMethod] public string GetDate () {return DateTime. now. toString ("yyyy-MM-dd hh: mm: ss");} [WebMethod] public string Login (string username, string pwd) {if (username = "admin" & pwd = "888888") {return "true";} else {return "false ";}}}}
The above is all the content of this article, hoping to help you learn.