G
Guest
This works, i adds a confirm box to a datagrid control. However is this the
correct way to check for the an item or alt item in the onitemdatabound
event/sub?
Private Sub dgOrders_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
dgOrders.ItemDataBound
If e.Item.ItemIndex <> -1 Then
Dim thslnkBtn As LinkButton
thslnkBtn = e.Item.FindControl("delThis")
thslnkBtn.Attributes.Add("onClick", "return confirm('Are you
sure you wish to delete this item?');")
End If
End Sub
or should it be done like the C# way "if(e.Item.FindControl("DeleteLink") !=
null))".
If so how?
thanks
kes
(i like the C# way better:
correct way to check for the an item or alt item in the onitemdatabound
event/sub?
Private Sub dgOrders_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
dgOrders.ItemDataBound
If e.Item.ItemIndex <> -1 Then
Dim thslnkBtn As LinkButton
thslnkBtn = e.Item.FindControl("delThis")
thslnkBtn.Attributes.Add("onClick", "return confirm('Are you
sure you wish to delete this item?');")
End If
End Sub
or should it be done like the C# way "if(e.Item.FindControl("DeleteLink") !=
null))".
If so how?
thanks
kes
(i like the C# way better: