Ejemplo n.º 1
0
        protected void btnWriteComment_Click(object sender, EventArgs e)
        {
            NoteComment comment = new NoteComment();

            comment.BoardId  = Convert.ToInt32(Request["Id"]); // 게시글 번호
            comment.Name     = txtName.Text;
            comment.Password = txtPassword.Text;
            comment.Opinion  = txtOpinion.Text;                                                // 댓글 내용

            _repo.AddNoteComment(comment);                                                     // 저장

            Response.Redirect($"{Request.ServerVariables["SCRIPT_NAME"]}?Ud={Request["Id"]}"); // BoardView.aspx 등 동적으로 웹페이지 이름을 차단
        }