I want to delete a record from a GridView. Before that, ask to confirm how “Are you sure you want to delete?”
I used the command field in the GridView,
<asp:CommandField HeaderText="Delete" ShowDeleteButton="True" />
I wrote a function in javascript
function confirm_Delete()
{
var r = confirm("Are you sure you want to Remove this Record!");
if (r == true)
{
alert("Record Deleted");
return true;
}
else
{
return false;
}
}
As I will call it when deleting a click. Please suggest!
source
share