c# - not able get message in chat application when successfully logs in -
i want create simple chat application.. have used below link http://www.codeproject.com/articles/17617/create-a-chat-system-using-ajax-and-asp-net
after writing below code able redirect chat.aspx page
protected void btnjoin_click(object sender, eventargs e) { if (getuser(txtusername.text, txtpassword.text)) { if(c.checkuser(txtusername.text)) { // lblerror.text = "you in chat room already!"; session["username"] = txtusername.text; response.write("<script language=\"javascript\">" + "\n"); response.write("window.open(\"chat.aspx\",\"chat\",\"width=800\",\"height=600\",\"toolbar=no\",\"menubar=no\")" + "\n</script>"); } else { c.addcustomer(txtusername.text); cc.joinroom(txtusername.text); session["username"] = txtusername.text; response.write("<script language=\"javascript\">" + "\n"); response.write("window.open(\"chat.aspx\",\"chat\",\"width=800\",\"height=600\",\"toolbar=no\",\"menubar=no\")" + "\n</script>"); //response.redirect("chat.aspx"); } } else { lblerror.text = "login failed"; } }
but can see name of user repeatedly in right panel...i f 2 user online name of 2 user should display can see name of same user more once
i had made changes in customermanagement.cs , working
public void addcustomer(string suser) { string caddtext = "<strong>" + suser + "</strong>"; if (checkuser(suser)==false) { carray.add(caddtext); } if (carray.count > 200) { carray.removerange(0, 10); } }
c# asp.net
No comments:
Post a Comment