javascript 调用websevice 内的方法不到 是怎么回事? - Web 开发 / Ajax
webservice代码:
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Services;using System.Data.SqlClient;using System.Data;using Maticsoft.BLL;/// <summary>/// Summary description for WebService/// </summary>[WebService(Namespace = "http://tempuri.org/")][WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. [System.Web.Script.Services.ScriptService]public class WebService : System.Web.Services.WebService { public WebService () { //Uncomment the following line if using designed components //InitializeComponent(); } [WebMethod] public string HelloWorld() { return "Hello World"; } [WebMethod] public string UserLogin(string username,string userpwd,string yzm) { if (new Maticsoft.BLL.UserInfo().Exists(username)) { DataTable table = new Maticsoft.BLL.UserInfo().GetList(" (UserName='" + username + "' or UserMaill='" + username + "') and UserPwd='" + userpwd + "' ").Tables[0]; if (table.Rows.Count > 0) { return "OK"; } else { return "NO"; } } else { return "用户名不存在"; } } }