Display Confirmation Message Before Deleting a Record from Database

Last Reply on Dec 12, 2012 08:27 AM By Andrea

Posted on Dec 12, 2012 08:27 AM

i have a web in asp.net+vb code and sql database

Protected Sub movebtn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles movebtn.Click
        Dim con As New SqlConnection
        con.ConnectionString = ConfigurationManager.ConnectionStrings("26ConnectionString").ConnectionString
        con.Open()
        If persno.Text = "" Then
            Page.ClientScript.RegisterStartupScript(Me.GetType, "Forms", "<script> alert('Enter Pers No of Offr ..........') </script>")
            persno.Focus()
            Exit Sub
        End If
        Dim sql_ins, sql_del As String
       sql_ins = "insert into NE_offrs select * from col_data where pnumb='" + notxt.Text + "'"
        sql_del = "delete col_data where pnumb='" + notxt.Text + "'"
        Dim sqlcom As New SqlCommand(sql_ins, con)
        Dim sqlcom1 As New SqlCommand(sql_del, con)
        sqlcom.ExecuteNonQuery()
        sqlcom1.ExecuteNonQuery()
        Page.ClientScript.RegisterStartupScript(Me.GetType, "Forms", "<script> alert('Record Moved to Promoted/Retired Table Successfully........')</script>")
          End Sub
  • I WANT TO ADD A CONFIRMATION BEFORE DELETING THE DATA AND POPUP MESSAGE BOX 

You are viewing reply posted by: Andrea on Dec 12, 2012 08:27 AM.
Posted on Dec 12, 2012 08:27 AM
Hi @baijuep,
Please try the following

Confirmation dialog box before deleting a record .

It might help you.

Cheers Andrea.