在我的经验中,我称之为简单的网络方法。
[WebMethod]
public List<string> GetUserListByLetters(string strLetters){ ... }
这里是我关于Complete JS-Function:
function OnComplete(args) {
...
if (args != "") {
for (var i = 0; i < args.length; i++) {
// Do what I need with string in args[i]
}
}
...
}
我现在想有这样的方法:
[WebMethod]
public string GetUserListByCountry(int countryId, out List<User> users)
{
users=null;
if ( Validate(countryId)==false )
return "wrong country Id";
users = GetUsers(countryId); // returns list of User objects.
return "";
}
Question1: should "out" parameter work in WS? I saw few article (, for example) where said it is impossible. Question2: if it doesn t work, how should I change method signature to get that workable? Question3: if it works, how could I access data from out parameter?
感谢。