if (e.CommandName == "Del")
{
ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "Startup", "<script>return ConfirmOnDelete();</script>", false);
try
{
foreach (GridDataItem i in dgTempList.MasterTableView.GetSelectedItems())
{
DateTime deletedOn = DateTime.Now;
string id = i["column"].Text;
Controllers.TempListController.DeleteTempList(Convert.ToInt32(id), deletedOn);
}
}
catch
{
}
dgTempList.Rebind();
}
ADDED RETURN before your javascript function
, When your javascript function return false then no
DELETE
operation will perform any action and when it returns true then
DELETE
operation will perform.
Thanks