想要仅在用户正在查看的文章上获得评论的更新。
Controller:
public void CommentAdded(string commentid, string username, string articleid)
{
Clients.Client(articleid).ArticleAdded(articleid, username);
}
Script:
conn.client(articleid).articleAdded = function (commentid, username, articleid) {
// code to append item to GUI
};