|
-
Oct 21st, 2004, 08:02 AM
#1
Thread Starter
Fanatic Member
Return confirm from Datagrid Delete button
I have a datagrid with a delete button. The delete part works, what I want is a confirm button that says are you sure with an ok or cancel button.
Anyone have an ideas on this. I tried to put an onclick even in this line
Code:
<asp:ButtonColumn Text="Delete" CommandName="Delete"></asp:ButtonColumn>
This did not work.
Thanks
Last edited by indydavid32; Oct 25th, 2004 at 11:52 AM.
David Wilhelm
-
Oct 21st, 2004, 08:37 AM
#2
Thread Starter
Fanatic Member
I tried this...
VB Code:
Private Sub DataGrid1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles DataGrid1.ItemDataBound
DataGrid1.Controls.Add(New LiteralControl("<SCRIPT FOR=""" & e.Item.Controls(8).ClientID.ToString() & """ EVENT=""onclick"" Language=""JavaScript"">if(!confirm('Are you sure?')){return false; window.event.cancelBubble=true;}</SCRIPT>" & vbCrLf))
End Sub
No confirm button is popping up when I click the delete button. I believe the column # should be 1, I tried 0 through 8.
-
Oct 25th, 2004, 11:52 AM
#3
Thread Starter
Fanatic Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|