Hi,
do not use HttpContext.Current.Session("UID"), use the identity object.
Here is code of DotNetNuke, you can learn from it :
- Public Overrides Function GetContacts(ByVal identity As CuteChat.ChatIdentity) As CuteChat.IChatUserInfo()
-
- Dim portalid As Integer = 0
-
- Dim list As ArrayList = DotNetNuke.Entities.Users.UserController.GetUsers(portalid)
-
- Dim res As New ArrayList
-
- Dim provider As CuteChat.ChatProvider = CuteChat.ChatProvider.Instance
-
- Dim myname As String = provider.FromUserId(identity.UniqueId)
-
- For Each info As DotNetNuke.Entities.Users.UserInfo In list
-
- f Not String.Equals(info.Username, myname, StringComparison.OrdinalIgnoreCase) Then
-
- res.Add(Me.GetUserInfo(provider.ToUserId(info.Username)))
-
- nd If
-
- Next
-
- Return res.ToArray(GetType(CuteChat.IChatUserInfo))
-
- End Function
Regards,
Terry