Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

How can I debug simple ajax call to Controller failure

$
0
0

My jquery ajax call below is always returning error.  First time ajax for me, I have followed the samples here but I cannot get successful call.  I did prove via debug that Controller is successfully returning a query result set, so the problem must be in the ajax call below.  Thanks for any help.

$('.link_board_filter_image').click(function () {
var dataObject = JSON.stringify({
'p_db_type': $(this).data("db_type"),
'p_sch': $(this).data("sch"),
'p_own': $(this).data("own"),
'p_env': $(this).data("env"),
'p_object_type': $(this).data("object_type"),
});
alert("dataObject: " + dataObject);  // at runtime this looks perfect.

$.ajax({
type: 'POST',
async: false,
dataType: 'json',
contentType: 'application/json',

data: dataObject,

success: function (data) {
response($.map(data.d, function (item) {
return { value: item }
}))
},
error: function (result) {
alert("Error: " + result.error);  //when runtime this result.error string is unhelpful (to me)
}
});
});


Viewing all articles
Browse latest Browse all 5678

Trending Articles