protected void btnSendMessage_Click(object sender, EventArgs e) { String content = txtSendMessage.Text; CommunicationClass.insertMessage(conversationID, user, content); gvMessages.DataSource = CommunicationClass.getMessages(conversationID); gvMessages.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { conversationID = Session["conversationID"].ToString(); //debug //conversationID = "BobJen"; user = Session["User"].ToString(); gvMessages.DataSource = CommunicationClass.getMessages(conversationID); gvMessages.DataBind(); }
protected void gvMessages_SelectedIndexChanged(object sender, EventArgs e) { //String conversationID = gvMessages.Rows[gvMessages.SelectedIndex].Cells[3].Text; int messageID = Convert.ToInt32(gvMessages.Rows[gvMessages.SelectedIndex].Cells[3].Text); Session["conversationID"] = conversationID; CommunicationClass.deleteMessage(messageID); gvMessages.DataSource = CommunicationClass.getMessages(conversationID); gvMessages.DataBind(); }