您好,欢迎访问一九零五行业门户网

jQuery AJAX 调用 WebService 的实例_PHP教程

用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]默认是注释的,要把注释去掉
http://www.bkjia.com/phpjc/364545.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/364545.htmltecharticle用jquery调用其他项目的webservice 实现登录验证功能 html输入用户名密码: 代码 table style=width: 400px tr td style=width: 200px class=left login id: /td td s...
其它类似信息

推荐信息