Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Adding Confirmation Message on DATAGRID Item Delete

Thread Tools

Adding Confirmation Message on DATAGRID Item Delete
Posts: n/a
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

e.Item.Cells(5).Attributes.Add("onclick", "return
confirmDelete (this.form);") // If its the 5 th Column in the

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 ?')



You Should be all set .

Hope It Helps

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a confirmation pop-up window for datagrid delete Elton W ASP .Net 0 05-15-2005 08:47 PM
adding delete confirmation Mike Brearley ASP General 4 07-06-2004 07:28 PM
Datagrid Item Delete Confirmation not working Nedu N ASP .Net 2 12-04-2003 02:16 AM
Datagrid Item Delete Confirmation not working Nedu N ASP .Net Datagrid Control 2 12-04-2003 02:16 AM
Re: delete confirmation in datagrid sramruttun ASP .Net 0 07-04-2003 06:47 AM