textbox 값 변경하기

조회수 1123회
        protected void insert_Click(object sender, EventArgs e)
        {

            string changeText = contentBox.Text;

            string Board_id = Request["board_id"];

            if (contentBox.Text!= null)
            {
                SqlConnection con = DBConn.GetSchebule_Con();
                //SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["Test"].ConnectionString);
                string strsql = "update borad set content = '" + contentBox.Text + "' where board_id = '" + Board_id + "'";
                SqlCommand cmd = new SqlCommand(strsql, con);
                con.Open();
                SqlDataReader rd = cmd.ExecuteReader();

                string script = "<script type='text/javascript'>alert('" + contentBox.Text +  "'); location.href='borad.aspx';</script>";
                this.ClientScript.RegisterClientScriptBlock(this.GetType(), "save", script);

                rd.Close();
                con.Close();
            }
        }

버튼을 누를시 DB에 저장되는 수정버튼을 만들었는대 contentBox.Text의 값이 새롭게 입력한 값이 아닌 sql에 저장된 값이 있습니다.

새롭게 입력한 값이 적용하려면 어떠한 소스를 추가해야하나요?

  • (•́ ✖ •̀)
    알 수 없는 사용자

답변을 하려면 로그인이 필요합니다.

프로그래머스 커뮤니티는 개발자들을 위한 Q&A 서비스입니다. 로그인해야 답변을 작성하실 수 있습니다.

(ಠ_ಠ)
(ಠ‿ಠ)