hello ,
How to add message when i want to delete a data like
idnamev:
kankon
datestart - dateend
20-01-2021 - 25-01-2021
protected void OnRowDeleting(object sender, GridViewDeleteEventArgs e)
{
int Id = Convert.ToInt32(gvFiles.DataKeys[e.RowIndex].Values[0]);
string constr = ConfigurationManager.ConnectionStrings["kankonConnectionString"].ConnectionString;
using (SqlConnection con = new SqlConnection(constr))
{
using (SqlCommand cmd = new SqlCommand("vacation"))
{
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@Action", "DELETE");
cmd.Parameters.AddWithValue("@Id", Id);
cmd.Connection = con;
con.Open();
cmd.ExecuteNonQuery();
con.Close();
}
}
BindGridView();
}
html:
<asp:CommandField ButtonType="Link" ShowEditButton="true" ShowDeleteButton="true" HeaderText="تعديل" ControlStyle-Width="50" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="50">
<ControlStyle Width="50px"></ControlStyle>
<HeaderStyle HorizontalAlign="Center" Width="50px"></HeaderStyle>
</asp:CommandField>