Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
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 12:48pm
Danda90416
Edited 9-Apr-11 3:39am
Dalek Dave432.9K
v4
Comments
Keith Barrow at 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 at 9-Apr-11 8:39am
   
Edited for Grammar, Syntax and Readability.

1 solution

Rate this: bad
good
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? Smile | :)
  Permalink  
v2
Comments
Dalek Dave at 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
0 OriginalGriff 195
1 ProgramFOX 130
2 Maciej Los 105
3 Sergey Alexandrovich Kryukov 85
4 Afzaal Ahmad Zeeshan 82
0 OriginalGriff 6,564
1 Sergey Alexandrovich Kryukov 6,048
2 DamithSL 5,228
3 Manas Bhardwaj 4,717
4 Maciej Los 4,150


Advertise | Privacy | Mobile
Web03 | 2.8.1411022.1 | Last Updated 9 Apr 2011
Copyright © CodeProject, 1999-2014
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