0

This is for reloading the current page. I used it for after comment the page.

Page.Response.Redirect(Page.Request.Url.ToString(), true);

        protected void btn_insertComment_Click(object sender, EventArgs e)
        {
            SqlCommand cmd = new SqlCommand("insert into Comment(commentNameSurname,commentEmail,commentContent,commentPicture,articleId) Values('" + txt_NameSurname.Text + "','" + txt_Email.Text + "', '" + txt_Comment.Text + "','/theme/comment.png', '" + articleId + "')", connect.connect());
            cmd.ExecuteNonQuery();
            SqlCommand cmdInsert = new SqlCommand("Update Article Set articleNumOfComment = articleNumOfComment+1 where makaleId='" + articleId + "'", connect.connect());
            cmdInsert.ExecuteNonQuery();

            lbl_info.Text = "It has done";
            txt_NameSurname.Text = "";
            txt_Email.Text = "";
            txt_Comment.Text = "";

            Page.Response.Redirect(Page.Request.Url.ToString(), true);  //sayfa yenilensin diye      

        }

Edited by yonca.karagoz

3
Contributors
3
Replies
23
Views
2 Years
Discussion Span
Last Post by Van4.NET
0

Thanks for sharing the information though I expected a question.

Edited by Van4.NET: spell mistake

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.