views:

32

answers:

1

Hi, I'm creating a chat widget that will be dropped into CommunityServer. The widget works great, but I just discovered that if I drop two of these widgets onto the same page, only one of them works! And I'm quite certain the reason is because the chat window is defined in ASP, and now there are two instances of the chat window, with the same ID, on the same page.

I am doing this with straight ASP & Javascript (not by choice), so my chat window is defined as: <telerik:RadListBox ID="rlbMessages" runat="server" > (don't mind that it's a telerik control).

So I was hoping I could do something like this: <telerik:RadListBox ID="<%= 'rlbMessages' + chatRoomID %>" runat="server" >

But from what I've gathered, apparently you can't assign ID's this way? What is the alternative?

A: 

With Telerik and .NET in general you'l find the code likes to own all the IDs. As a work-around you can use unique CSS class names.

Diodeus
It looks like I'm approaching this the wrong way. I have multiple instances of the same Javascript functions. I chose this as the correct answer anyway; it's true.
mattdell