I am calling a webmethod from jquery and get the json object but I cannot parse and read the json object. please help me find what I am doing wrong. I have 3 alert() and I am putting comments next to them what they show...
my jquery code is this
$('#btn_second').click(function () {
//$('#txt_isim_4').val('test arif');
$.ajax({
type: "POST",
url: "Registration.aspx/get_selected_professional",
data: "{'id':'2'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
alert('1:' + data); // display [object Object]
alert('2:' + data.d.firstname); // display undefined
alert('3:' + data.d); // display [{"id":"2","firstname":"arif"}]
}
});
});
but I want to display only "Arif". is my json object wrong? should I use single quotation?
thank you