One of the useful features in a Windows desktop application that many programmers and end-users take for granted is message boxes. Two of the most common types of message boxes are alerts and confirms. A confirm message box prompts the user if they want to continue, and provides two choices: “OK” and “Cancel”. Clicking “OK” confirms the action, while “Cancel” cancels it.
Private Sub Page_Load(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles MyBase.Load If (Not Page.IsPostBack) Then Me.BtnDelete.Attributes.Add("onclick", _ "return confirm('Are you sure you want to delete?');") End If End Sub