Hi ,
I am new to jquery ..my service is not calling .i dono how to resolve this.
Any one can help me out
Regards,
gayathri reddy
What I have tried:
$(document).ready(function () {
$('#btnSubmit').click(function (event) {
debugger
var url = "http://localhost:35013/UserService.svc/ValidateUser/" + $('#sender-email').val() + "/" + $('#user-pass').val();
$.getJSON(url, function (data) {
if (data.ValidateUserResult.length > 0) {
alert("logged in");
}
});
});
});
[ServiceContract]
public interface IUserService
{
[OperationContract]
[WebInvoke(Method = "GET", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "ValidateUser/{LoginID}/{Password}")]
User ValidateUser(string LoginID, string Password);
}
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
public class UserService : IUserService
{
public User ValidateUser(string LoginID, string Password)
{
Membership.ValidateUser(LoginID, Password);
User _obj = new User();
_obj.LoginID = LoginID;
return _obj;
}
}