[WebMethod] public Boolean Login(string uname, string password) { if (ValidateUser(uname, password)) { FormsAuthentication.Authenticate(uname, password); return true; } return false; }
$(document).ready(function () { $('#btnLogin').click(function () { var username = "test" var password = "1234" $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "wsLogin.asmx/Login", data: "{uname: '" + username + "'" + ",pwd: '" + password + "' }", dataType: "Json", success: function (success) { alert("Boolean True"); }, error: function (error) { alert("Boolean False"); } }); }); });
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)