Wrox Programmer Forums
BOOK: ASP.NET Website Programming Problem-Design-Solution
This is the forum to discuss the Wrox book ASP.NET Website Programming: Problem - Design - Solution, Visual Basic .NET Edition by Marco Bellinaso, Kevin Hoffman; ISBN: 9780764543869
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET Website Programming Problem-Design-Solution section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old October 1st, 2003, 06:37 PM
Authorized User
Join Date: Jul 2003
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default Pop up Delete confirmation box...

Has anyone created a confirmation pop box(OK, Cancel) when clicking on delete buttons within the DataGrids. For example, would like to include this feature in the NewsGrid of the Admin News.aspx file.

I have created this pop up box in the EditRoles.aspx page, but it is just tied to a regular button(not within a DataGrid). I just put the following code within the Page_Load:
RemoveRoleButton.Attributes.Add("onClick", "return confirm('Are you sure you want to delete Current Role?');");

Any suggestions for adding this pop up confirmation to a button in a DataGrid?

Old October 8th, 2003, 01:41 PM
Registered User
Join Date: Jun 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

You have to place it in the item_databound event of the data grid.
Something like this.

' Look to see if the item type is not the header or footer
If e.Item.ItemType <> ListItemType.Header And e.Item.ItemType <> ListItemType.Footer Then
' Create referance to our Delete LinkButton
Dim lb As LinkButton = e.Item.Cells(1).Controls(0)

' Load Delete LinkButton attributes 'OnClick' to display the following script when 'OnClick' event is fired

lb.Attributes("onclick") = "javascript:return confirm('Are you sure you want to delete this Debit Entry Item" & "?')"

End IF

Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete Confirmation From within a Gridview rit01 ASP.NET 2.0 Professional 5 March 8th, 2007 06:47 PM
Confirmation Pop Up Window Ronb722 Java Basics 0 March 15th, 2006 11:51 AM
confirmation from user from a delete button in the sansircar ASP.NET 1.0 and 1.1 Professional 1 January 25th, 2006 01:44 PM
Confirmation message on delete of Data grid item hardik@saltriver.com VS.NET 2002/2003 1 December 22nd, 2004 02:27 AM
delete confirmation yami56 Access 2 April 7th, 2004 12:09 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.