I spent the whole of last night searching for a free AspNet web chat control that I could simply drag into my website. Well the search was in vain as I could not find a control that matched my needs i.e List of users, 1 to 1 chat, Ability to kick out users..
In the end I decided to create my own control from scractch. Although it works well on my machine Im concerned that It maybe a little crude and unpractical on a shared hosting enviroment.
Basically this is what I did :
Then the 'crude' part :
..and then I made it all work like this In the timer tick event I 'refreshed' the messages display by invoking Databind() on my repeater i.e
protected void Timer1_Tick(object sender, EventArgs e)
{
MyRepeater.DataBind();
}
Then in my send button click event
protected void btnSend_Click(object sender, EventArgs e)
{
MyDataLayer.InsertMessage(Message, Sender, CurrTime);
}
Well It works well on my machine and Ive got the other functionalities(users list, kick out user..) to work by simply creating more tables.
But like I said it seems a little crude to me. so I need a proffesional opinion. Should I run with this or try another Approach ?
I'm not sure why you think it is crude - I would expect any other ASP.NET chat control to be developed in exactly the same fashion using client-side polling. As an alternative to using Update panels however, I would recommend writing the client-side AJAX functionality using JQuery (or some other Javascript framework) - the ASP.NET Update panel is really just a standard ASP.NET postback using a rendering trick so the screen doesn't have to be refreshed.
In regards to running with what you've got, if you've gone as far as you have already, I would continue on. It will be a great learning exercise on the requirements for your chat client even if you decide to replace it with something else down the track.