为什么我会收到此错误:
myhub.cs:
public class ChatHub : Hub
{
private static DataTable ConnectedClientDt = null;
public void ConnectClient(string ClientName)
{
if (ConnectedClientDt == null)
{
ConnectedClientDt = new DataTable();
ConnectedClientDt.Columns.Add("ClienID");
ConnectedClientDt.Columns.Add("ClientName");
}
ConnectedClientDt.Rows.Add(Context.ConnectionId,ClientName);
}
客户端 :
$(document).ready(function () {
var chat = $.connection.chatHub;
var clientName = '<%=Session["ClientName"] %>';
$.connection.hub.start().done(function () {
chat.server.ConnectClient(clientName);
});
请有任何帮助