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에 저장된 값이 있습니다.
새롭게 입력한 값이 적용하려면 어떠한 소스를 추가해야하나요?
-
(•́ ✖ •̀)
알 수 없는 사용자
댓글 입력