e certo che ho ragione!
ma si può fare pure così, uomo di poca fede
codice:
Protected Sub miaFunzione(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.CommandEventArgs)
PrintLn(e.CommandArgument, "miaFunzione: " & e.CommandName)
End Sub
Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
Dim r As GridViewRow = e.Row
Dim b As ImageButton = TryCast(r.FindControl("ImageButton1"), ImageButton)
If b IsNot Nothing Then
AddHandler b.Command, AddressOf miaFunzione
End If
End Sub
ma che vantaggio c'è? è conveniente usarlo, secondo me, solo in gridview annidate