Thursday, December 10, 2009

webservice consuming through jQuery - parameter

I have a web service which will check the user name and password against database.I used to send 2 parameters one is user id and password.If both are matched then status will be comes

$.ajax({
type: "POST",
url: "LoginService.asmx/AuthenticateMethod",
data: "{'UserName': '" + $("#TextBox1").val() +"', 'Password': '" + $("#TextBox2").val() + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg)
{
$("#status").html(msg.d);
}
});