kylkc.cn kylkc.cn

欢迎光临
我们一直在努力
顶部
域名
云服务器48/月

jQuery AJAX 调用WebService实现代码_jquery-js教程-

用jQuery调用其他项目的WebService
实现登录验证功能
html输入用户名密码:
代码

复制代码 代码如下:















Login ID:



Login Password:








Jquery引用和登录事件
代码
复制代码 代码如下:




serviceURL类似:var serviceURL = "http://localhost:1742/SoldierServices.asmx";
WebService代码:
代码
复制代码 代码如下:

///
/// Summary description for SoldierServices
///

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
// 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 SoldierServices : System.Web.Services.WebService
{
[WebMethod]
public User UserLogin(string UserLoginID, string UserLoginPW)
{
LoginBusiness lb = new LoginBusiness();
return lb.UserLogin(UserLoginID, UserLoginPW);
}
[WebMethod]
public User GetUserInfo(string UserID)
{
LoginBusiness lb = new LoginBusiness();
return lb.GetUserInfo(UserID);
}
}

注意:[System.Web.Script.Services.ScriptService]默认是注释的,要把注释去掉
【声明】:本博客不参与任何交易,也非中介,仅记录个人感兴趣的主机测评结果和优惠活动,内容均不作直接、间接、法定、约定的保证。访问本博客请务必遵守有关互联网的相关法律、规定与规则。一旦您访问本博客,即表示您已经知晓并接受了此声明通告。
发布内容
-六神源码网 网站出售带数据-六神源码网 网站出售带数据-六神源码网 网站出售带数据-六神源码网