1.
Add a hyperlink button column to the DataGrid, set the text to "Delete", and add the following code to the aspx page
<script language="JavaScript">
function delete_confirm(e){
if(event.srcElement.outerText=="Delete"||event.srcElement.name=="btnDictDel")
event.returnValue=confirm("This operation will be permanently deleted, are you sure to delete it?");
}
document.onclick=delete_confirm;
</script>
2. Add a hyperlink button column to the DataGrid, set the ID to "del", and bind the data.
for(int i=0;i< myCount;i++)
{
((ImageButton)dataGrid.Items[i].FindControl("del")).Attributes.Add("onclick","return confirm('This operation will be permanently deleted, are you sure to delete it?");')");
}
http://www.cnblogs.com/bccu/archive/2006/11/02/548296.html