>Protected Sub gvUsers_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvUsers.RowDataBound > If (e.Row.RowType = DataControlRowType.DataRow) Then > Dim ib As ImageButton = DirectCast(e.Row.Cells(6).Controls(0), ImageButton) > ib.Attributes.Add("onClick", "var ch=confirm('Do you want to delete');if(ch==false) return false;") > End If > End Sub >BTW, in your code you forgot a question mark at the end :)