The following is the json response
{"d":[{"__type":"Treking.Data.Users.Owner","MembershipId":null,"FirstName":"siva","MobileNo":"9886811237","EmailId":"[email protected]","PhoneNo":""}]}
Client Side js is as follows
function GetInfo() {
var checkboxInfo = $('#<%= chkboxContact.ClientID %>');
var domcheckboxInfo= checkboxInfo[0];
if (domcheckboxInfo.checked == true) {
$.ajax(
{
type: "Post",
url: "../ProfileService.asmx/GetUserInfo",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
var str = (typeof response.d) == 'string' ? eval('(' + response.d + ')') : response.d;
for (var i = 0; i < str.length; i++) {
var firstname = str[i].FirstName;
var MobileNo = str[i].MobileNo;
var EmailId = str[i].EmailId;
var PhoneNo = str[i].PhoneNo;
}
$('#<%=txtboxContactperson.ClientID %>').text = firstname;
$('#<%=txtboxEmailId.ClientID %>').text = EmailId;
$('#<%=txtboxMobileNo.ClientID %>').text = MobileNo;
$('#<%=txtboxTelephone.ClientID %>').text = PhoneNo;
}, failure: function (response) {
alert(response.d + "FAILED");
}
});
}
}
i have a asp.net checkbox with an id of chkboxContact onchange i call this javascript function. but the control jumps of the success and it does not enter it ,the control from sucess jumps to failure but does not enter the failure function.Please Guide