Click here to Skip to main content
13,097,230 members (63,166 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I've been working on this web chat application Build a Web Chat Application using Build a Web Chat Application using ASP.Net 3.5, LINQ and AJAX (in C# 3.5 or VB 9.0)[^] but there's always a problem I tried a lot to solve but no hope.

Which is: I have specific rooms and each room is specified to certain users so that users in one room can talk together without people in other rooms can see them.
The problem is that users enter wrong rooms!

Although they are directed to the right room, their names are added to the wrong room list!

I used the same code as in the link before and I tested it and it has the same problem!

Please, can anyone help me.

[Edit - corrected Link - Henry /]
Posted 3-Apr-11 11:48am
Updated 9-Apr-11 2:39am
Dalek Dave433.3K
Keith Barrow 3-Apr-11 18:21pm
Without any code it is difficult to tell what is going on. The link is broken or it as been removed. If you are referring to an article, please ask you question in the comments at the bottom of the article screen, no-one knows the code better than the author!
Dalek Dave 9-Apr-11 8:39am
Edited for Grammar, Syntax and Readability.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

112 if (user == null)
113 {
114 LoggedInUser loggedInUser = new LoggedInUser();
115 loggedInUser.UserID = Convert.ToInt32(Session["ChatUserID"]);
116 loggedInUser.RoomID = Convert.ToInt32(lblRoomId.Text);
117 db.LoggedInUsers.InsertOnSubmit(loggedInUser);
118 db.SubmitChanges();
119 }

If you used the code from the article and redirected to a different roomid (on the querystring in the demo), but you forgot to update line 116 (above) to the correct roomid, that would cause the problem you describe. (note: it's taking the id from a form value instead of the session value) That it? :)
Dalek Dave 9-Apr-11 8:39am
Well Spotted.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.170813.1 | Last Updated 9 Apr 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100