protected void SubmitEdit_Click(object sender, EventArgs e) { CommentManagementBO bo = new CommentManagementBO(); //A stupid little hack I'm having to put in, because my properties keep getting reset to null CommentVO commentVO = bo.GetComment(Convert.ToInt32(commentID.Text)); try { //Check for no text if (editTextBox.Text.Equals("")) { throw new Exception(NO_TEXT_EXCEPTION); } //Edit comment string comText = editTextBox.Text; comText = Server.HtmlEncode(comText); comText = comText.Replace(Environment.NewLine, "<br/>"); commentVO.CommentContents = comText; bo.UpdateComment(commentVO); this.Visible = false; Response.Redirect(Request.Url.ToString()); } catch (Exception exc) { errorLabel.Text = exc.Message; } }