Two methods with different signatures, jquery is not calling correct method
- by Lee
There are two methods GetUserAssignedSystems() and GetUserAssignedSystems(string Id)
These methods act very differently from each other. The problem is, when I want to call GetUserAssignedSystems(string Id), the parameter-less method is called.
Here are the methods:
[WebMethod]
[ScriptMethod]
public IEnumerable GetUserAssignedSystems(string cacId)
{
return Data.UserManager.GetUserAssingedSystems(cacId);
}
[WebMethod]
[ScriptMethod]
public IEnumerable GetUserAssignedSystems()
{
//do something else
}
Here is the jquery making the 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 being ignored?