samedi 21 novembre 2015

Unable to Update User status after logged out in using single R

I have used above links code and modify this code and add some line in above linked project as below lines.

In chat.aspx....

  chat.client.onUserDisconnected = function (id, userName) { $.connection.hub.start(); }

In Chat.cs...

public override Task OnDisconnected()
            var newUsers = OnlineUser.userObj.FirstOrDefault(item => 
                item.connectionId  == Context.ConnectionId);
            if (newUsers != null)
                var id = newUsers.connectionId;
                OnlineUser.RemoveOnlineUser(id, newUsers.userName,        newUsers.userId);

            //return Clients.All.joined(Context.ConnectionId, newUsers);
            return Clients.Caller.OnlineStatus(Context.ConnectionId, newUsers); 

After added abobe line in project then user status update but it is not update on any user page who are online. Please help me to resolve this issues.

Aucun commentaire:

Enregistrer un commentaire