i am using gridview,in that gridview i provide a link button as delete,if the user click the delete button,it will deleted properly no problem in my code,before delete i want to show an dialog box like, are you want to delete the employee details,,how can i do this in my code..
Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles GridView1.RowCommand
If (e.CommandName = "DELETE_Employeeid") Then
'Delete button is clicked
Dim empid = e.CommandArgument.ToString()
connection.ConnectionString = ("Data Source=RIFAYEE-PC;Initial Catalog=OpalAsia;Integrated Security=True")
connection.Open()
If DropDownList1.SelectedIndex = 1 Then
cmd = New SqlCommand("delete from empopaldepot where empid=@empid", connection)
Dim ProductIdParameter = New SqlParameter("@empid", empid)
ProductIdParameter.Value = empid
cmd.Parameters.Add(ProductIdParameter)
cmd.ExecuteNonQuery()
Response.Redirect(Request.Url.AbsoluteUri)
loadopaldepot()