I have a small problem, with my webservice call. I've debugged it, and the webservice gets called, with the correct value and it also returns the correct value. However, my alert (in the completed function)says: 'undefined'. What am I doing wrong? Here's my function:
function GetServiceValue() {
var Parameter = "{contextKey: '" + $('#<%= ProjectNumText.ClientID %>').val() + "'}";
alert('Para: ' + Parameter);
$.ajax({
type: 'Post',
url: 'DynamicPopulateService.asmx/GetProjectName',
data: Parameter,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
AjaxSucceeded(msg);
},
error: AjaxFailed
});}
And here is the completed function:
function AjaxSucceeded(data)
{
alert(data.responseText);
}