Two methods with different signatures, jquery is not calling correct method
Posted
by Lee
on Stack Overflow
See other posts from Stack Overflow
or by Lee
Published on 2010-06-15T16:07:13Z
Indexed on
2010/06/15
16:12 UTC
Read the original article
Hit count: 193
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?
© Stack Overflow or respective owner