There are two methods GetUserAssignedSystems()and GetUserAssignedSystems(string Id)
these methods operate completely different from each other. The problem is that when I want to call GetUserAssignedSystems(string Id), the method without the parameter is called.
Here are the methods:
[WebMethod]
[ScriptMethod]
public IEnumerable GetUserAssignedSystems(string cacId)
{
return Data.UserManager.GetUserAssingedSystems(cacId);
}
[WebMethod]
[ScriptMethod]
public IEnumerable GetUserAssignedSystems()
{
}
Here is the jQuery call:
CallMfttService("ServiceLayer/UserManager.asmx/GetUserAssignedSystems",
"{'cacId':'" + $('#EditUserCacId').val() + "'}", function(result) {
for (var userSystem in result.d) {
$('input[UserSystemID=' + result.d[userSystem] + ']').attr(
'checked', 'true');
}
});
Any ideas why this method is ignored?
UPDATE
Here is the code for CallMfttService
function CallMfttService(method, jsonParameters, successCallback, errorCallback){
if (errorCallback == undefined)
{
errorCallback = function(xhr)
{
if (xhr.status == 501)
{
alert(xhr.statusText);
}
else
{
alert("Unexpected Error");
}
}
}
$.ajax({
type: "POST",
url: method,
data: jsonParameters,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: successCallback,
error: errorCallback
});
}
Avien source
share