Dear Experts,
I have a Datagrid with delete options. I use to confirm from users and delete record from data grid. I give confrimation after each record has deleted when a DataGridCommand EventArgs event occured.
But when i am navigating to some other pages and press the back button this delete confirmation popup occured once again. How to handle it.
Please do it need full.
Regards,
Prasath
I have a Datagrid with delete options. I use to confirm from users and delete record from data grid. I give confrimation after each record has deleted when a DataGridCommand EventArgs event occured.
Code:
protected void SetDeleteButton(Object sender, DataGridCommandEventArgs e)
{
try
{
if (e.CommandName == "Delete")
{
grdAdminAccount.EditItemIndex = -1;
if (e.Item.Cells[1].Text.ToLower() != "admin")
{
Management.DeleteAdmin(e.Item.Cells[1].Text, Convert.ToInt16(e.Item.Cells[0].Text));
string popupScript = "<script language='javascript' >" + "alert('The Administrator account is successfully deleted.');" + "</script>";
Page.RegisterStartupScript("PopupScript", popupScript);
if (grdAdminAccount.CurrentPageIndex > 0 && e.Item.ItemIndex == 0 && grdAdminAccount.Items.Count <= 1)
{
grdAdminAccount.CurrentPageIndex = grdAdminAccount.CurrentPageIndex - 1;
}
FileGrid();
}
}
}
catch (Exception ex)
{
Response.Redirect("default.aspx?action='Error'", false);
}
}
Please do it need full.
Regards,
Prasath
Comment