今天就跟大家聊聊有關(guān)ajax中怎么傳遞多個(gè)參數(shù),可能很多人都不太了解,為了讓大家更加了解,小編給大家總結(jié)了以下內(nèi)容,希望大家根據(jù)這篇文章可以有所收獲。
具體內(nèi)容如下
用戶(hù)名
密碼
WebService1.asmx
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Services; namespace ajax11 { ////// WebService1 的摘要說(shuō)明 /// [WebService(Namespace = "/tupian/20230522/ [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] // 若要允許使用 ASP.NET AJAX 從腳本中調(diào)用此 Web 服務(wù),請(qǐng)取消對(duì)下行的注釋。 [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 "用戶(hù)名已被占用,請(qǐng)選擇其他"; } else { return "可以使用,請(qǐng)繼續(xù)"; } } [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"; } } } }
看完上述內(nèi)容,你們對(duì)ajax中怎么傳遞多個(gè)參數(shù)有進(jìn)一步的了解嗎?如果還想了解更多知識(shí)或者相關(guān)內(nèi)容,請(qǐng)關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝大家的支持。