Private Sub DataGrid1_ItemDataBound (ByVal sender As Object, ByVal e As DataGridItemEventArgs) Handles DataGrid1.ItemDataBound Dim l As LinkButton If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem then l = CType(e.Item.Cells(0).FindControl("cmdDel"), LinkButton) l.Attributes.Add("onclick" , "return getconfirm( );") End If End Sub Getconfirm() 関数は最初の関数と同じです function getconfirm() { if (confirm ("レコードを削除しますか?")==true) return true; else return }