I don't know about you, but I can't count how many times when I first installed IBS, about how a content editor deleted something by mistake, because they clicked on the delete icon next to item in IBS. One thing lacking in IBS is a confirmation from the application whether or not you want to delete an item.

Figure 1: Tabs Section of IBS
As in figure when a person goes to delete a tab in IBS, no warning will be issued, it will just delete the tab. From the layout of IBS, the icons for moving, editing, and deleting are pretty close together. You can see how someone can inadvertently delete and item from there. What we need to accomplish is the functionality to allow a person to back out of deleting and item in case they clicked on the wrong button. In this example we will be modifying the TabLayout.aspx.vb file to add a bit of Javascript behind the button.
If you open the TabLayout.aspx.vb file and look for the Page_Load method, we're going to add the following code:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e _
As System.EventArgs) Handles MyBase.Load
' Verify that the current user has access to access this page
If PortalSecurity.IsInRoles("Admins") = False Then
Response.Redirect("~/Admin/EditAccessDenied.aspx")
End If
' Determine Tab to Edit
If Not (Request.Params("tabid") Is Nothing) Then
tabId = Int32.Parse(Request.Params("tabid"))
End If
' If first visit to the page, update all entries
If Page.IsPostBack = False Then
' Now add the modified code for the delete confirmation.
LeftDeleteBtn.Attributes.Add("onClick", _
"javascript:return confirm('Are You Sure You Wish To Delete This Item ?');")
RightDeleteBtn.Attributes.Add("onClick", _
"javascript:return confirm('Are You Sure You Wish To Delete This Item ?');")
ContentDeleteBtn.Attributes.Add("onClick", _
"javascript:return confirm('Are You Sure You Wish To Delete This Item ?');")
BindData()
End If
End Sub
The code above should then add a Javascript confirmation to your image button, in the following way:

So now if the user decides to cancel the delete it will still be there. No more calls to you to restore the database.
By: Patrick Santry, Microsoft MVP (ASP/ASP.NET), developer of this site, author of books on Web technologies, and member of the DotNetNuke core development team. If you're interested in the services provided by Patrick, visit his company Website at Santry.com.