A hub function can accept an array of strings, a list of strings, etc.
Here's an example hub:
public class myHub : Hub { public void receiveList(List<String> mylist) { mylist.Add("z"); Caller.returnList(mylist); } }
Here is an example of a JS part for working with a hub:
var myHub = $.connection.myHub, myArray = ['a','b','c']; myHub.client.returnList = function(val) { alert(val);
source share