Javascript alert() when deleting rec with gridview

  • Thread starter Thread starter loga123
  • Start date Start date
L

loga123

I am using a gridview with ASP 2.0 and VB.Net 2005. I would like to be
able to pop-up a javascript alert('Are you sure') confirmation when the
user clicks the 'Delete link' without adding an additional column for
this, but I cannot figure out how. Can someone help? Thanks.
 
you will have to point the "delete link" to a javascript function.
inside that javascript function, add the confirmation. you will have to
create a processing page to perform the delete, but this will give you
the desired result.

function ShowConfirmProcessing(url)
{
var result = confirm("You have selected items for
processing. This cannot be undone. Are you sure that you want to
proceed?")
if(result == true)
{
location.href = url;
}
else
{
alert('No accounts have been processed');
}
}
 
Back
Top