R
rajeshgujar
Here is What needs to be Done
In Your DataGrid do this
1 ] Private Sub DGReference_ItemDataBound(ByVal sender As Object,
ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles
DGReference.ItemDataBound
e.Item.Cells(5).Attributes.Add("onclick", "return
confirmDelete (this.form);") // If its the 5 th Column in the
Datagrid
End Sub
2 ] Private Sub DGReference_EditCommand(ByVal source As Object, ByVal
e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles
DGReference.EditCommand, DGReference.DeleteCommand
Select Case (CType(e.CommandSource, LinkButton)).CommandName
Case "Delete"
/// Give Your Delete Database Logic Here
End Select
End Sub
3 ] In the HTML Code in the Head Section
<script language="javascript">
function confirmDelete (frm)
{
return confirm ('Are you sure you want to delete ?')
}
</script>
You Should be all set .
Hope It Helps
In Your DataGrid do this
1 ] Private Sub DGReference_ItemDataBound(ByVal sender As Object,
ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles
DGReference.ItemDataBound
e.Item.Cells(5).Attributes.Add("onclick", "return
confirmDelete (this.form);") // If its the 5 th Column in the
Datagrid
End Sub
2 ] Private Sub DGReference_EditCommand(ByVal source As Object, ByVal
e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles
DGReference.EditCommand, DGReference.DeleteCommand
Select Case (CType(e.CommandSource, LinkButton)).CommandName
Case "Delete"
/// Give Your Delete Database Logic Here
End Select
End Sub
3 ] In the HTML Code in the Head Section
<script language="javascript">
function confirmDelete (frm)
{
return confirm ('Are you sure you want to delete ?')
}
</script>
You Should be all set .
Hope It Helps