Use jQuery to call WebService of other projects
Implement login verification function
html enter username and password:
Code
Jquery reference and login event
Code
://localhost:1742/SoldierServices.asmx";
WebService code:
Code
Copy code
The code is as follows :
///
/// 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.
return lb.UserLogin(UserLoginID, UserLoginPW);
}
[WebMethod]
public User GetUserInfo(string UserID)
{
LoginBusiness lb = new LoginBusiness();
return lb.GetUserInfo(UserID);
}
}
Note : [System.Web.Script.Services.ScriptService] is commented by default. You need to remove the comments.