Hi Willemt,
Please try the example below. It is the vb.net example.
- <%@ Page Language="VB" %>
- <%@ Import Namespace="System.Data" %>
- <%@ Import Namespace="System.Data.SqlClient" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
- <script runat="server">
- Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
- If Not Me.IsPostBack Then
- Dim lobbies As ArrayList = New ArrayList
- For Each lobby As CuteChat.LobbyInfo In CuteChat.ChatApi.GetLobbyInfoArray
- If ((lobby.Lobby.Integration = "") _
- OrElse (lobby.Lobby.Integration Is Nothing)) Then
- lobbies.Add(lobby)
- End If
- Next
- Me.DataList_Lobbies.DataSource = lobbies
- AddHandler Me.DataList_Lobbies.ItemDataBound, AddressOf Me.rptLobbies_ItemDataBound
- Me.DataList_Lobbies.DataBind()
- End If
- If (CuteChat.ChatApi.GetLobbyInfoArray.Length < 1) Then
- Literal1.Text = "<p style='font-size:14px;'>There is no chat room availables now.<br><br>Please login as admin and cre" & _
- "ate chat rooms in the admin console!</p>"
- End If
- End Sub
-
-
- Private Sub rptLobbies_ItemDataBound(ByVal sender As Object, ByVal e As DataListItemEventArgs)
- If (e.Item.DataItem Is Nothing) Then
- Return
- End If
- Dim lobby As CuteChat.LobbyInfo = CType(e.Item.DataItem, CuteChat.LobbyInfo)
- Dim lnkLobby As HyperLink = CType(e.Item.FindControl("lnkLobby"), HyperLink)
- lnkLobby.NavigateUrl = (CuteChat.ChatWebUtility.ResolveResource(Me.Context, "Channel.Aspx") & ("?Place=Lobby-" & lobby.Lobby.LobbyId))
- lnkLobby.Target = "_blank"
- Dim sOnlineChater As String = lobby.JoinClient(",")
- Dim lblOnlineChater As Label = CType(e.Item.FindControl("lblOnlineChater"), Label)
- lblOnlineChater.Text = lobby.ClientCount.ToString
- lnkLobby.ToolTip = sOnlineChater
- End Sub
- </script>
-
- <html xmlns="http://www.w3.org/1999/xhtml" >
- <head runat="server">
- <title>chat room</title>
- </head>
- <body>
- <form id="form1" runat="server">
- <div class="infobox" style="width: 700px; margin: 30px auto">
- <h2>
- Chat
- </h2>
- <div class="padding10">
- <table cellspacing="0" border="0" cellpadding="8" style="width: 90%">
- <tr>
- <td>
- <asp:DataList ID="DataList_Lobbies" CellSpacing="3" Width="400" RepeatColumns="2"
- runat="server">
- <ItemTemplate>
- <asp:HyperLink ID="lnkLobby" runat="server">
- <nobr><img src="images/home.gif" width="49" height="49" border="0" align="middle"><%#DataBinder.Eval(Container.DataItem, "Name")%></nobr>
- </asp:HyperLink>
- <br />
- (
- <asp:Label ID="lblOnlineChater" runat="server"></asp:Label>
- chatting)
- </ItemTemplate>
- </asp:DataList>
- <asp:Literal ID="Literal1" runat="server" />
- </td>
- <td>
- <img alt="" src="images/cutechat_picture.jpg" height="180" />
- </td>
- </tr>
- </table>
- </div>
- </div>
- </form>
- </body>
- </html>
Regards,
Ken