Ajax passes the implementation code of multiple parameters, while ajax passes multiple parameters

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.