Esempio 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;                // 댓글

            // 데이터 입력
            _repository.AddNoteComment(comment);

            Response.Redirect(
                $"{Request.ServerVariables["SCRIPT_NAME"]}?Id={Request["Id"]}");//동적으로 웹페이지를 움직이게 한다.
        }